Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const flags = toFlags(opts, { allowCamelCase: true });
const configDir = path.join(__dirname, 'configs', name);
const configPath = path.join(configDir, 'config.js');
// const createConfig = require(configDir);
const { default: createConfig } = await import(configDir);
const config = createConfig({ ...opts, ignores, input: inputs });
const contents = `module.exports=${JSON.stringify(config)}`;
fs.writeFileSync(configPath, contents);
// eslint-disable-next-line global-require
console.log('Jest', require('jest/package.json').version);
console.log(`jest -c ${configPath} ${flags}`);
return exec(`jest -c ${configPath} ${flags}`, { stdio: 'inherit' });
});
}
const cfg = {}
if (require('jest/package.json').version.split('.').shift() === '22') {
Object.assign(cfg, require('ts-jest/presets').defaults)
} else {
cfg.preset = 'ts-jest'
}
module.exports = Object.assign({}, cfg, {
collectCoverage: true,
collectCoverageFrom: ["**/*.ts", "!**/*.d.ts", "!**/build/**", "!/FrontEnd/**"],
forceCoverageMatch: ["**/*.test.ts"],
coverageDirectory: "Tests/coverage",
coverageReporters: ["lcov"],
rootDir: "..",
testMatch: ["**/*.test.ts"],
testEnvironment: "node",
globals: {
"ts-jest": {
export function jestTestRunnerFactory(injector: Injector) {
return injector
.provideValue(PROCESS_ENV_TOKEN, process.env)
.provideValue(JEST_VERSION_TOKEN, require('jest/package.json').version as string)
.provideFactory(JEST_TEST_ADAPTER_TOKEN, jestTestAdapterFactory)
.injectClass(JestTestRunner);
}
jestTestRunnerFactory.inject = tokens(commonTokens.injector);
function versionInfo() {
return `jest-webpack ${require('./package.json').version}\n` +
`jest ${require('jest/package.json').version}\n` +
`webpack ${require('webpack/package.json').version}`;
}
export function jestTestRunnerFactory(injector: Injector) {
return injector
.provideValue(PROCESS_ENV_TOKEN, process.env)
.provideValue(JEST_VERSION_TOKEN, require('jest/package.json').version as string)
.provideFactory(JEST_TEST_ADAPTER_TOKEN, jestTestAdapterFactory)
.injectClass(JestTestRunner);
}
jestTestRunnerFactory.inject = tokens(commonTokens.injector);