Skip to content

Commit

Permalink
Fixed the test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavprajapatiFynd committed Dec 3, 2024
1 parent 7f5ff5b commit 831b837
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tests/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jest.mock('next', () => () => ({
}));

const request = require('supertest');
const { app } = require('../../server');
const { app, getServerInstance } = require('../../server');
const SESSION_COOKIE_NAME = 'ext_session';
const cookieParser = require('cookie-parser');
const cookie = require('cookie');
Expand Down Expand Up @@ -64,6 +64,13 @@ jest.mock('crypto-js/hmac-sha256', () => {
});

describe('Custom Next.js server', () => {

afterAll((done) => {
// Close the server after tests are complete
const server = getServerInstance();
server.close(done);
});

let sessionCookieValue = '';

it('POST /ext/webhook: Should receive webhook event successfully', async () => {
Expand Down

0 comments on commit 831b837

Please sign in to comment.