test suit updated

This commit is contained in:
2026-07-17 14:08:00 +02:00
parent 729b7f566f
commit d73aa076ad
10 changed files with 624 additions and 73 deletions
+21
View File
@@ -0,0 +1,21 @@
const request = require('supertest');
const express = require('express');
const versionRouter = require('../src/api/version');
const app = express();
app.use(versionRouter);
describe('GET /version', () => {
it('should return JSON with badgedexVersion', async () => {
const res = await request(app).get('/version');
expect(res.statusCode).toBe(200);
expect(res.headers['content-type']).toMatch(/json/);
expect(res.body).toHaveProperty('badgedexVersion');
expect(typeof res.body.badgedexVersion).toBe('string');
});
it('should return a valid semver-like version string', async () => {
const res = await request(app).get('/version');
expect(res.body.badgedexVersion).toMatch(/^\d+\.\d+\.\d+/);
});
});