UNPKG

@o3r/schematics

Version:

Schematics module of the Otter framework

33 lines 949 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTestFramework = getTestFramework; const index_1 = require("../../utility/index"); const testPackageMaps = { jest: ['jest'], jasmine: ['jasmine-core'] }; /** * Get the test framework * @param workspaceOptions the workspace options * @param context */ function getTestFramework(workspaceOptions, context) { if (workspaceOptions) { const testFramework = (0, index_1.getSchematicOptions)(workspaceOptions, context)?.testFramework; if (testFramework) { return testFramework; } } return Object.entries(testPackageMaps) .find(([_, deps]) => { return deps.some((dep) => { try { return !!require.resolve(`${dep}/package.json`); } catch { return false; } }); })?.[0]; } //# sourceMappingURL=index.js.map