@yolkai/nx-schematics
Version:
30 lines (29 loc) • 1.68 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("@angular-devkit/schematics/testing");
const path = require("path");
const fs_1 = require("fs");
describe('Update 7.0.2', () => {
let initialTree;
let schematicRunner;
beforeEach(() => __awaiter(this, void 0, void 0, function* () {
initialTree = schematics_1.Tree.empty();
schematicRunner = new testing_1.SchematicTestRunner('@yolkai/nx-schematics', path.join(__dirname, '../migrations.json'));
}));
it('should changeAutoWatch to true in the shared karma.conf.js', () => __awaiter(this, void 0, void 0, function* () {
initialTree.create('karma.conf.js', fs_1.readFileSync(path.join(__dirname, './test-files/karma.conf.js')).toString());
const result = yield schematicRunner
.runSchematicAsync('update-7.0.2', {}, initialTree)
.toPromise();
expect(result.readContent('karma.conf.js')).toContain('autoWatch: true');
}));
});