Conversation
| "type": "module", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", |
There was a problem hiding this comment.
you can directly run jest
There was a problem hiding this comment.
When I directly run jest it's complaining of the import statement.
There was a problem hiding this comment.
Google how to solve it.
api/test/status.test.js
Outdated
| /** | ||
| * Test the GET route for home / | ||
| */ | ||
| describe('Dao API', () => { |
There was a problem hiding this comment.
change this to 'Status API'
api/test/status.test.js
Outdated
| */ | ||
| describe('Dao API', () => { | ||
| it('returns status to be OK', async () => { | ||
| const apiUrl = 'http://localhost:2015/'; |
There was a problem hiding this comment.
You can create a file called utils.js and have the apiurl there. and import it and use it here. So, you dont have to copy paste it every time and if the API url changes we change it in one place.
api/utils/api-url.js
Outdated
| @@ -0,0 +1,5 @@ | |||
| const apiConfig = { | |||
There was a problem hiding this comment.
This should be in tests folder.
also, this should be like
export const API_URL='https://localhost:2015'
web-app/src/tests/App.test.js
Outdated
| const browser = await puppeteer.launch({}); | ||
| const page = await browser.newPage() | ||
|
|
||
| await page.emulate({ |
There was a problem hiding this comment.
Remove page.emulate - we dont need this.
| */ | ||
| describe('On page load', () => { | ||
| test('Home page loads correctly', async () => { | ||
| const browser = await puppeteer.launch({}); |
There was a problem hiding this comment.
I don't understand the review here.
| const html = await page.$eval('h5', e => e.innerHTML); | ||
| expect(html).toBe('Login or Register'); | ||
|
|
||
| browser.close(); |
.github/workflows/api.yaml
Outdated
|
|
||
| on: | ||
| push: | ||
| branches: [ dev ] |
There was a problem hiding this comment.
This should work on all branches and not just dev. Please fix this for the other job as well.
No description provided.