server test changes
This commit is contained in:
@ -1,2 +0,0 @@
|
|||||||
DATABASE_URL="postgresql://localhost:5432/atlas"
|
|
||||||
SEQUELIZE_SECRET=7a947f4b6b5cd4c769029f7b5130c85fe2d3484758c0eeee351cd2e2d2c3bd59
|
|
13
package.json
13
package.json
@ -27,8 +27,15 @@
|
|||||||
"^.*[.](s?css|css)$": "<rootDir>/__mocks__/styleMock.js",
|
"^.*[.](s?css|css)$": "<rootDir>/__mocks__/styleMock.js",
|
||||||
"^.*[.](gif|ttf|eot|svg)$": "<rootDir>/__test__/fileMock.js"
|
"^.*[.](gif|ttf|eot|svg)$": "<rootDir>/__test__/fileMock.js"
|
||||||
},
|
},
|
||||||
"moduleFileExtensions": ["js", "jsx", "json"],
|
"moduleFileExtensions": [
|
||||||
"moduleDirectories": ["node_modules", "server"],
|
"js",
|
||||||
|
"jsx",
|
||||||
|
"json"
|
||||||
|
],
|
||||||
|
"moduleDirectories": [
|
||||||
|
"node_modules",
|
||||||
|
"server"
|
||||||
|
],
|
||||||
"modulePaths": [
|
"modulePaths": [
|
||||||
"frontend"
|
"frontend"
|
||||||
],
|
],
|
||||||
@ -133,7 +140,7 @@
|
|||||||
"slug": "0.9.1",
|
"slug": "0.9.1",
|
||||||
"string-hash": "^1.1.0",
|
"string-hash": "^1.1.0",
|
||||||
"style-loader": "0.13.0",
|
"style-loader": "0.13.0",
|
||||||
"truncate-html": "0.0.6",
|
"truncate-html": "https://github.com/jorilallo/truncate-html/tarball/master",
|
||||||
"url-loader": "0.5.7",
|
"url-loader": "0.5.7",
|
||||||
"uuid": "2.0.2",
|
"uuid": "2.0.2",
|
||||||
"validator": "5.2.0",
|
"validator": "5.2.0",
|
||||||
|
@ -8,11 +8,11 @@ import { flushdb, seed, sequelize } from '../test/support';
|
|||||||
const server = new TestServer(app.callback());
|
const server = new TestServer(app.callback());
|
||||||
|
|
||||||
beforeEach(flushdb);
|
beforeEach(flushdb);
|
||||||
beforeEach(seed);
|
|
||||||
afterAll(() => server.close());
|
afterAll(() => server.close());
|
||||||
afterAll(() => sequelize.close());
|
afterAll(() => sequelize.close());
|
||||||
|
|
||||||
it('should return known user', async () => {
|
it('should return known user', async () => {
|
||||||
|
await seed();
|
||||||
const user = await User.findOne({
|
const user = await User.findOne({
|
||||||
where: {
|
where: {
|
||||||
email: 'user1@example.com',
|
email: 'user1@example.com',
|
||||||
@ -29,6 +29,7 @@ it('should return known user', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should require authentication', async () => {
|
it('should require authentication', async () => {
|
||||||
|
await seed();
|
||||||
const res = await server.post('/api/user.info');
|
const res = await server.post('/api/user.info');
|
||||||
const body = await res.json();
|
const body = await res.json();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user