-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests setup, fix integration test concurrently issues
- Loading branch information
1 parent
7af8336
commit 8f13f33
Showing
7 changed files
with
1,188 additions
and
2,681 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,3 @@ | ||
import { jest } from '@jest/globals' | ||
|
||
global.jest = jest |
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,34 @@ | ||
import { validateThesisData } from './thesis' | ||
|
||
describe('validateThesisData', () => { | ||
let req | ||
let res | ||
let next | ||
|
||
beforeEach(() => { | ||
req = { | ||
body: {}, | ||
} | ||
res = {} | ||
next = jest.fn() | ||
}) | ||
|
||
it('should call next if all required fields are present', () => { | ||
req.body = { | ||
topic: 'Test thesis', | ||
supervisions: [{ percentage: 100 }], | ||
authors: [{}], | ||
researchPlan: {}, | ||
waysOfWorking: {}, | ||
startDate: '2021-01-01', | ||
endDate: '2021-12-31', | ||
} | ||
req.files = { | ||
researchPlan: [{}], | ||
waysOfWorking: [{}], | ||
} | ||
|
||
expect(validateThesisData(req, res, next)).toBeUndefined(); | ||
expect(next).toHaveBeenCalledTimes(1) | ||
}) | ||
}) |
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