http-status-codes#OK TypeScript Examples
The following examples show how to use
http-status-codes#OK.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: get.manifest.test.ts From typescript.service.boilerplate with MIT License | 5 votes |
describe('[ADAPTERS] - Express server', () => {
let server: Server;
beforeAll(() => {
server = runServer(parseInt(SERVER_PORT, 10));
});
afterAll(() => {
server.close();
});
describe(`[GET] ${MANIFEST_ROUTE} endpoint`, () => {
const manifestUrl = host.concat(MANIFEST_ROUTE);
test('must return the current manifest content successfully', async (done) => {
let obtainedError = null;
try {
const result = await axios.get(manifestUrl);
const { data, status } = result;
expect(data).not.toBeUndefined();
expect(data).not.toBeNull();
expect(data).not.toEqual({});
expect(status).toBe(OK);
expect(data).toHaveProperty('name');
expect(data.name).toBe(manifest.name);
expect(data).toHaveProperty('version');
expect(data.version).toBe(manifest.version);
expect(data).toHaveProperty('timestamp');
expect(data.timestamp).toBe(manifest.timestamp);
expect(data).toHaveProperty('scm');
expect(data.scm).toHaveProperty('remote');
expect(data.scm.remote).toBe(manifest.scm.remote);
expect(data.scm).toHaveProperty('branch');
expect(data.scm.branch).toBe(manifest.scm.branch);
expect(data.scm).toHaveProperty('commit');
expect(data.scm.commit).toBe(manifest.scm.commit);
} catch (error) {
obtainedError = { ...error };
expect(obtainedError).toBeNull();
} finally {
done();
}
});
});
});