Skip to content

Commit

Permalink
feature(comment): Update seeders
Browse files Browse the repository at this point in the history
  • Loading branch information
tejiri4 committed Jan 18, 2019
1 parent 4a002e4 commit ef2734e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "rimraf build/* && babel ./ -d build --ignore 'node_modules','coverage' ",
"start": "node build/index.js",
"dev": "nodemon --exec babel-node ./index.js --env",
"db:migrate:test": "cross-env NODE_ENV=test node_modules/.bin/sequelize db:migrate:undo:all && cross-env NODE_ENV=test node_modules/.bin/sequelize db:migrate && npm run test-seed",
"db:migrate:test": "cross-env NODE_ENV=test npm run migrate && npm run test-seed",
"test": "npm run db:migrate:test && cross-env NODE_ENV=test nyc mocha ./server/test --exit --timeout=20000 --recursive",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"heroku-postbuild": "npm run build"
Expand Down
4 changes: 2 additions & 2 deletions server/middlewares/AuthMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AuthMiddleware {
error: {
message: 'Token is invalid, You need to log in again'
}
},
}
});
}

Expand All @@ -50,7 +50,7 @@ class AuthMiddleware {
data: {
error: {
message: 'An error occured on the server',
error,
error
}
}
});
Expand Down
11 changes: 1 addition & 10 deletions server/seeders/20190115151310-demoUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ export default {
bio: 'Gitting Started',
password: 'Blahblah',
authTypeId: '15745c60-7b1a-11e8-9c9c-2d42b21b1a3e'
},
{
id: '34745c60-6b1a-11e8-6c9c-2d42b21b1a3e',
fullName: 'Joy',
userName: 'Joy4',
email: 'joy@now.com',
bio: 'Gitting Started',
password: 'Blahblah',
authTypeId: '15745c60-7b1a-11e8-9c9c-2d42b21b1a3e'
}], {}),

down: (queryInterface, Sequelize) => queryInterface.bulkDelete('Users', null, {})
};
};
4 changes: 2 additions & 2 deletions server/seeders/20190115151322-demoArticle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
up: (queryInterface, Sequelize) => queryInterface.bulkInsert('Articles', [{
id:'95745c60-7b1a-11e8-9c9c-2d42b21b1a3e',
id: '95745c60-7b1a-11e8-9c9c-2d42b21b1a3e',
slug: 'What-a-mighty-God',
title: 'Mighty God',
content: 'Hallelujah',
Expand All @@ -9,4 +9,4 @@ export default {
}], {}),

down: (queryInterface, Sequelize) => queryInterface.bulkDelete('Articles', null, {})
};
};
2 changes: 1 addition & 1 deletion server/test/mockData/token.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TokenManager from '../../helpers/TokenManager';

const token = TokenManager.sign({
userId: '34745c60-6b1a-11e8-6c9c-2d42b21b1a3e',
userId: '45745c60-7b1a-11e8-9c9c-2d42b21b1a3e',
email: 'jesseinit@now.com',
roleId: 1
});
Expand Down

0 comments on commit ef2734e

Please sign in to comment.