Initial commit: Inventory Barcode System
This commit is contained in:
17
__tests__/server.test.js
Normal file
17
__tests__/server.test.js
Normal file
@ -0,0 +1,17 @@
|
||||
const request = require('supertest');
|
||||
const app = require('../server');
|
||||
|
||||
describe('Server', () => {
|
||||
test('GET / should return HTML page', async () => {
|
||||
const response = await request(app).get('/');
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.headers['content-type']).toMatch(/html/);
|
||||
});
|
||||
|
||||
test('GET /health should return status OK', async () => {
|
||||
const response = await request(app).get('/health');
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.body.status).toBe('OK');
|
||||
expect(response.body.timestamp).toBeDefined();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user