UNPKG

@cypress/schematic

Version:
21 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const schematics_1 = require("@angular-devkit/schematics"); const cypress_test_1 = require("../cypress-test"); const path = require("path"); function default_1(options) { return (_, _context) => { return (0, schematics_1.chain)([ (0, schematics_1.externalSchematic)('@schematics/angular', 'component', Object.assign(Object.assign({}, options), { skipTests: true })), (tree, _context) => { const componentName = path.parse(options.name).name; const componentPath = tree.actions.filter((a) => a.path.includes(`${componentName}.component.ts`)) .map((a) => path.dirname(a.path)) .at(0); return componentPath ? (0, cypress_test_1.default)(Object.assign(Object.assign({}, options), { component: true, path: componentPath, name: componentName })) : (0, schematics_1.noop)(); }, ]); }; } exports.default = default_1; //# sourceMappingURL=index.js.map