@yolkai/nx-workspace
Version:
48 lines (47 loc) • 2.33 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const testing_1 = require("@yolkai/nx-workspace/testing");
const testing_2 = require("../../utils/testing");
const ast_utils_1 = require("@yolkai/nx-workspace/src/utils/ast-utils");
describe('Update 8.2.0', () => {
let tree;
beforeEach(() => __awaiter(this, void 0, void 0, function* () {
tree = testing_1.createEmptyWorkspace(schematics_1.Tree.empty());
tree = yield testing_2.callRule(ast_utils_1.updateJsonInTree('workspace.json', json => {
json.projects['my-app'] = {
root: 'my-app',
architect: {
lint: {
builder: '@angular-devkit/build-angular:tslint',
options: {
tsConfig: ['my-app/tsconfig.json'],
exclude: ['**/node_modules/**']
}
}
}
};
return json;
}), tree);
}));
it('should add exclusions for files other than the project root', () => __awaiter(this, void 0, void 0, function* () {
const result = yield testing_2.runMigration('update-8.2.0', {}, tree);
const workspaceJson = ast_utils_1.readJsonInTree(tree, 'workspace.json');
const project = workspaceJson.projects['my-app'];
expect(project.architect.lint).toEqual({
builder: '@angular-devkit/build-angular:tslint',
options: {
tsConfig: ['my-app/tsconfig.json'],
exclude: ['**/node_modules/**', '!my-app/**']
}
});
}));
});