Merge pull request #1716 from automatisch/AUT-828

refactor: rewrite useVersion and healthcheck with RQ
This commit is contained in:
Ali BARIN
2024-03-13 11:02:38 +01:00
committed by GitHub
8 changed files with 31 additions and 56 deletions

View File

@@ -1,9 +0,0 @@
import appConfig from '../../config/app.js';
const healthcheck = () => {
return {
version: appConfig.version,
};
};
export default healthcheck;

View File

@@ -1,27 +0,0 @@
import { describe, it, expect } from 'vitest';
import request from 'supertest';
import app from '../../app';
import appConfig from '../../config/app';
describe('graphQL healthcheck query', () => {
it('should return application version', async () => {
const query = `
query {
healthcheck {
version
}
}
`;
const response = await request(app)
.post('/graphql')
.send({ query })
.expect(200);
const expectedResponsePayload = {
data: { healthcheck: { version: appConfig.version } },
};
expect(response.body).toEqual(expectedResponsePayload);
});
});