-
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.
- Loading branch information
1 parent
a8d1464
commit a883932
Showing
1 changed file
with
27 additions
and
9 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 |
---|---|---|
@@ -1,27 +1,45 @@ | ||
import { expect, describe, beforeAll, afterAll, it } from '@jest/globals'; | ||
import request from 'supertest'; | ||
import server from '../src/index.js'; | ||
import { expect, describe, afterAll, it } from '@jest/globals'; | ||
|
||
/** Reminder : Please put mandatory environment variables in the settings of your github repository **/ | ||
describe('Test event.controller.js', () => { | ||
const storeKey = 'MY_STORE_KEY'; // Specify the key of Commercetools Store for product synchronization | ||
|
||
it(`POST /${storeKey}`, async () => { | ||
let response = {}; | ||
// Send request to the connector application with following code statement | ||
// Send request to the connector application with following code snippet. | ||
/** | ||
response = await request(server).post(`/${storeKey}`); | ||
**/ | ||
import request from 'supertest'; | ||
import server from '../src/index.js'; | ||
response = await request(server).post(`/${storeKey}`); | ||
**/ | ||
expect(response).toBeDefined(); | ||
}); | ||
|
||
it(`POST /`, async () => { | ||
const res = await request(server).post(`/`); | ||
expect(res.statusCode).toBe(404); | ||
let response = {}; | ||
// Send request to the connector application with following code snippet. | ||
/** | ||
import request from 'supertest'; | ||
import server from '../src/index.js'; | ||
response = await request(server).post(`/`); | ||
**/ | ||
expect(response).toBeDefined(); | ||
}); | ||
|
||
afterAll(() => { | ||
if (server) { | ||
// Enable the function below to close the application on server once all test cases are executed. | ||
/** | ||
if (server) { | ||
server.close(); | ||
} | ||
**/ | ||
}); | ||
}); |