update to more favorable testfile loading approach

This commit is contained in:
2017-07-30 22:27:51 +02:00
parent 0f5e451e60
commit e2d0a7a939
5 changed files with 2436 additions and 386 deletions

11
dist/mod02/index.js vendored
View File

@ -37,9 +37,6 @@ let tap = function (configArg) {
experimentalDecorators: true,
lib: ['DOM', 'ES5', 'ES2015.Promise', 'ES2015.Generator', 'ES2015.Iterable']
}),
plugins.gulpFunction.forEach((file) => __awaiter(this, void 0, void 0, function* () {
file.path = file.path.replace(paths.tsDir, paths.distDir);
})),
plugins.gulpSourcemaps.write(),
npmtsTapBuffer.pipeTestableFiles(),
plugins.smartstream.cleanPipe()
@ -49,14 +46,6 @@ let tap = function (configArg) {
*/
let testFilesSmartstream = new plugins.smartstream.Smartstream([
plugins.smartgulp.src([plugins.path.join(paths.cwd, 'test/*.ts')]),
plugins.gulpFunction.forEach((fileArg) => __awaiter(this, void 0, void 0, function* () {
let stringToModify = fileArg.contents.toString();
let testRegex = /\/\/\smodule\stestimport\nimport[a-zA-Z0-9\*\s]*\sfrom\s'(..\/ts\/index)'/;
let replacer = (match, group1, offset, completeString) => {
return match.replace(group1, '../dist/index');
};
fileArg.contents = Buffer.from(stringToModify.replace(testRegex, replacer));
})),
plugins.gulpSourcemaps.init(),
plugins.gulpTypeScript({
target: 'ES5',