mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
Co-authored-by: enisdenjo <badurinadenis@gmail.com> Co-authored-by: Denis Badurina <denis@domonda.com>
43 lines
975 B
TypeScript
43 lines
975 B
TypeScript
import { Dockest, logLevel } from '@n1ru4l/dockest';
|
|
import { cleanDockerContainers, createServices } from './testkit/dockest';
|
|
import dotenv from 'dotenv';
|
|
|
|
/**
|
|
* Run only the tests that were specified with a pattern or filename:
|
|
* $ pnpm dockest filenameOrPattern
|
|
*
|
|
* Run all tests:
|
|
* $ pnpm dockest
|
|
*/
|
|
const [, , testFile] = process.argv;
|
|
|
|
async function main() {
|
|
dotenv.config();
|
|
|
|
const dockest = new Dockest({
|
|
logLevel: logLevel.DEBUG,
|
|
jestOpts: {
|
|
runInBand: true,
|
|
testRegex: testFile ?? undefined,
|
|
config: JSON.stringify({
|
|
roots: ['<rootDir>/tests'],
|
|
transform: {
|
|
'^.+\\.ts$': 'ts-jest',
|
|
},
|
|
testTimeout: 30_000,
|
|
maxConcurrency: 1,
|
|
setupFiles: ['dotenv/config'],
|
|
setupFilesAfterEnv: ['./jest-setup.ts'],
|
|
}),
|
|
},
|
|
});
|
|
|
|
cleanDockerContainers();
|
|
|
|
return dockest.run(createServices());
|
|
}
|
|
|
|
main().catch(err => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|