@nx-plugins/astro
Version:
The Nx Plugin for Astro that contains executors, generators, and utilities for managing Astro applications and libraries within an Nx workspace.
27 lines • 1.75 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.addE2ERunner = void 0;
const tslib_1 = require("tslib");
const cypress_1 = require("@nrwl/cypress");
const playwright_1 = require("@nx-plugins/playwright");
const linter_1 = require("@nrwl/linter");
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
function addE2ERunner(host, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const tasks = [];
if (options.e2eTestRunner === 'playwright-test') {
tasks.push(yield (0, playwright_1.playwrightJSProjectGenerator)(host, Object.assign(Object.assign({}, options), { linter: options.linter === 'eslint' ? linter_1.Linter.EsLint : linter_1.Linter.None, name: `${options.name}-e2e`, directory: options.directory, project: options.projectName, baseUrl: 'http://localhost:3000', skipPackageJson: false })));
}
else if (options.e2eTestRunner === 'cypress') {
tasks.push((0, cypress_1.cypressInitGenerator)(host, {}));
tasks.push(yield (0, cypress_1.cypressProjectGenerator)(host, Object.assign(Object.assign({}, options), { linter: options.linter === 'eslint' ? linter_1.Linter.EsLint : linter_1.Linter.None, name: `${options.name}-e2e`, directory: options.directory, project: options.projectName, baseUrl: 'http://localhost:3000', skipPackageJson: false })));
}
else {
// eslint-disable-next-line @typescript-eslint/no-empty-function
tasks.push(() => { });
}
return (0, run_tasks_in_serial_1.runTasksInSerial)(...tasks);
});
}
exports.addE2ERunner = addE2ERunner;
//# sourceMappingURL=add-e2e-runner.js.map
;