Skip to content

Commit

Permalink
inital setup for search test (#2757)
Browse files Browse the repository at this point in the history
Add the setup path
  • Loading branch information
JiaHua-Zou authored Feb 1, 2022
1 parent 1d3a59e commit 9cfc73a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/api/search/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const baseConfig = require('../../../jest.config.base');

module.exports = {
...baseConfig,
rootDir: '../../..',
setupFiles: ['<rootDir>/src/api/search/jest.setup.js'],
testMatch: ['<rootDir>/src/api/search/test/*.test.js'],
collectCoverageFrom: ['<rootDir>/src.api/search/src/**/*.js'],
};
1 change: 1 addition & 0 deletions src/api/search/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env = { ...process.env, MOCK_ELASTIC: '1' };
9 changes: 9 additions & 0 deletions src/api/search/test/query.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const request = require('supertest');
const { app } = require('../src');

describe('/query routers', () => {
it('return error 400 if no params given', async () => {
const res = await request(app).get('/');
expect(res.status).toBe(400);
});
});

0 comments on commit 9cfc73a

Please sign in to comment.