console/integration-tests/dockest.ts
Dimitri POSTOLOV 12ceda69dc
Use pnpm instead of yarn (#477)
Co-authored-by: enisdenjo <badurinadenis@gmail.com>
Co-authored-by: Denis Badurina <denis@domonda.com>
2022-11-01 02:11:53 +02:00

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);
});