@nx/gatsby
Version:
Gatsby Plugin for Nx
28 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addJest = void 0;
const tslib_1 = require("tslib");
const devkit_1 = require("@nx/devkit");
const jest_1 = require("@nx/jest");
function addJest(host, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if ((options === null || options === void 0 ? void 0 : options.unitTestRunner) !== 'jest') {
return () => void 0;
}
const installTask = yield (0, jest_1.jestProjectGenerator)(host, {
project: options.projectName,
supportTsx: true,
skipSerializers: true,
setupFile: 'none',
compiler: 'babel',
js: options.js,
});
(0, devkit_1.updateJson)(host, `${options.projectRoot}/tsconfig.spec.json`, (json) => {
json.compilerOptions.jsx = 'react';
return json;
});
return installTask;
});
}
exports.addJest = addJest;
//# sourceMappingURL=add-jest.js.map