design-angular-kit
Version:
Un toolkit Angular conforme alle linee guida di design per i servizi web della PA
43 lines • 2.29 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const testing_1 = require("@angular-devkit/schematics/testing");
const path = require("path");
describe(`ng add design-angular-kit`, () => {
const collectionPath = path.join(__dirname, '../collection.json');
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
const defaultOptions = {
project: 'test-project', // Set your default project name
};
let appTree;
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
// Simulate an Angular workspace project before running the schematic
appTree = yield runner.runExternalSchematic('@schematics/angular', 'workspace', {
name: 'workspace',
version: '6.0.0',
newProjectRoot: 'projects',
});
appTree = yield runner.runExternalSchematic('@schematics/angular', 'application', {
name: defaultOptions.project,
standalone: false,
}, appTree);
}));
it('should add DesignAngularKitModule to package.json', () => __awaiter(void 0, void 0, void 0, function* () {
const tree = yield runner.runSchematic('ng-add', defaultOptions, appTree);
// Check if the package.json file exists
const packageJsonPath = '/package.json';
expect(tree.files).toContain(packageJsonPath);
// Check if the correct dependency was added
const content = tree.readContent(packageJsonPath);
expect(content).toContain(`"design-angular-kit"`);
}));
});
//# sourceMappingURL=index.spec.js.map
;