UNPKG

awesome-typescript-loader

Version:
38 lines 1.8 kB
"use strict"; 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()); }); }; var utils_1 = require('./utils'); describe('checker test', function () { this.timeout(5000); var fixture = new utils_1.Fixture("\n let a: string;\n function check(arg1: string) { }\n check(a);\n ", '.ts'); var config = utils_1.createConfig({ entry: fixture.path(), }, { watch: true, }); it('should watch changes', function () { return __awaiter(this, void 0, void 0, function* () { yield utils_1.cleanOutputDir(); var watcher = yield utils_1.watch(config); { var _a = yield watcher.wait(), err = _a[0], stats = _a[1]; utils_1.expect(err).not.ok; utils_1.expect(stats.compilation.errors).lengthOf(0); } { fixture.update(function (text) { return text.replace('let a: string;', 'let a: number;'); }); var _b = yield watcher.wait(), err = _b[0], stats = _b[1]; utils_1.expect(err).not.ok; utils_1.expect(stats.compilation.errors).lengthOf(1); } watcher.close(); }); }); }); //# sourceMappingURL=watch-type-errors.js.map