mirror of
https://github.com/directus/directus.git
synced 2026-01-31 15:57:57 -05:00
* Refactor e2e tests * Only install root dependencies for lint step * Fix dumbest error ever * Pass process.env too to spawned subprocess * Suppress npm package installation prompt * Improve error handling * Add new compose file for tests * Avoid port conflict with remoted * Update docker-compose.yml * Add test docs * Use current branch workflow files and simplify skips * Fix workflow file * Fix workflow file * Try adding `.yml` extension to allow reference in `uses` * Place workflow file in folders to allow reference in `uses` * Requires more work than expected, reverting * Update docs to use correct compose file * Remove comment / unused code * Run tests from main Co-authored-by: ian <licitdev@gmail.com> Co-authored-by: Jay Cammarano <jay.cammarano@gmail.com> Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
34 lines
760 B
TypeScript
34 lines
760 B
TypeScript
import request from 'supertest';
|
|
import config from '../config';
|
|
import vendors from '../get-dbs-to-test';
|
|
import knex, { Knex } from 'knex';
|
|
|
|
describe('/server', () => {
|
|
const databases = new Map<string, Knex>();
|
|
|
|
beforeAll(() => {
|
|
for (const vendor of vendors) {
|
|
databases.set(vendor, knex(config.knexConfig[vendor]!));
|
|
}
|
|
});
|
|
|
|
afterAll(() => {
|
|
for (const [_vendor, connection] of databases) {
|
|
connection.destroy();
|
|
}
|
|
});
|
|
|
|
describe('/ping', () => {
|
|
it.each(vendors)('%p', async (vendor) => {
|
|
const url = `http://localhost:${config.envs[vendor]!.PORT!}`;
|
|
|
|
const response = await request(url)
|
|
.get('/server/ping')
|
|
.expect('Content-Type', /text\/html/)
|
|
.expect(200);
|
|
|
|
expect(response.text).toBe('pong');
|
|
});
|
|
});
|
|
});
|