-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6790a1b
commit a79e0e8
Showing
5 changed files
with
1,721 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { | ||
default: Dockest, | ||
runners: { RedisRunner }, | ||
logLevel, | ||
} = require('dockest') | ||
|
||
const redis = new RedisRunner({ | ||
service: 'redis2000', | ||
image: 'redis:5.0.3', | ||
}) | ||
|
||
const dockest = new Dockest({ | ||
jest: { | ||
lib: require('jest'), | ||
verbose: true, | ||
}, | ||
opts: { | ||
logLevel: logLevel.DEBUG, | ||
runInBand: true, | ||
}, | ||
runners: [redis], | ||
}) | ||
|
||
dockest.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: ['/node_modules/'], | ||
roots: ['./routes'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const queues = require('./queues') | ||
|
||
jest.mock('./getDataForQeues', () => async () => '👋🏽 getDataForQeues') | ||
|
||
describe('queues', () => { | ||
const mockRequest = { app: { locals: { queues: jest.fn() } }, query: '' } | ||
const mockResponse = { json: jest.fn() } | ||
|
||
beforeEach(() => { | ||
mockResponse.json.mockClear() | ||
}) | ||
|
||
it('should work', async () => { | ||
const result = await queues(mockRequest, mockResponse) | ||
|
||
expect(result).toEqual(undefined) | ||
expect(mockResponse.json).toHaveBeenCalledWith('👋🏽 getDataForQeues') | ||
}) | ||
}) |
Oops, something went wrong.