mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 22:26:07 +00:00
Modify healthcheck.test
This commit is contained in:
@@ -1,11 +1,16 @@
|
|||||||
import { server } from '../src/app';
|
import { Server } from 'http';
|
||||||
|
import main from '../src';
|
||||||
import { describe, expect, it, beforeAll, afterAll } from '@jest/globals';
|
import { describe, expect, it, beforeAll, afterAll } from '@jest/globals';
|
||||||
import supertest from 'supertest';
|
import supertest from 'supertest';
|
||||||
import { setUpHealthEndpoint } from '../src/services/health';
|
import { setUpHealthEndpoint } from '../src/services/health';
|
||||||
|
|
||||||
const requestWithSupertest = supertest(server);
|
let requestWithSupertest: supertest.SuperTest<supertest.Test>;
|
||||||
|
let server: Server;
|
||||||
|
|
||||||
describe('Healthcheck endpoint', () => {
|
describe('Healthcheck endpoint', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
server = await main;
|
||||||
|
requestWithSupertest = supertest(server);
|
||||||
setUpHealthEndpoint(server);
|
setUpHealthEndpoint(server);
|
||||||
});
|
});
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
@@ -16,4 +21,4 @@ describe('Healthcheck endpoint', () => {
|
|||||||
const res = await requestWithSupertest.get('/healthcheck');
|
const res = await requestWithSupertest.get('/healthcheck');
|
||||||
expect(res.status).toEqual(200);
|
expect(res.status).toEqual(200);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -169,6 +169,7 @@ const main = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setUpHealthEndpoint(server);
|
setUpHealthEndpoint(server);
|
||||||
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
export default main();
|
||||||
Reference in New Issue
Block a user