chore(build): move build/transformCJSTests task to broccoli
This commit is contained in:
parent
7d29636087
commit
0107543a33
@ -370,11 +370,6 @@ gulp.task('build/transpile.js.cjs', transpile(gulp, gulpPlugins, {
|
|||||||
options: CONFIG.transpile.options.js.cjs,
|
options: CONFIG.transpile.options.js.cjs,
|
||||||
srcFolderInsertion: CONFIG.srcFolderInsertion.js
|
srcFolderInsertion: CONFIG.srcFolderInsertion.js
|
||||||
}));
|
}));
|
||||||
gulp.task('build/transformCJSTests', function() {
|
|
||||||
return gulp.src(CONFIG.dest.js.cjs + '/angular2/test/**/*_spec.js')
|
|
||||||
.pipe(transformCJSTests())
|
|
||||||
.pipe(gulp.dest(CONFIG.dest.js.cjs + '/angular2/test/'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build/transpile.dart', ['build.broccoli.tools'], function() {
|
gulp.task('build/transpile.dart', ['build.broccoli.tools'], function() {
|
||||||
return broccoliBuild(makeBroccoliTree('dart'), 'dart');
|
return broccoliBuild(makeBroccoliTree('dart'), 'dart');
|
||||||
@ -807,7 +802,6 @@ gulp.task('build.js.cjs', function(done) {
|
|||||||
runSequence(
|
runSequence(
|
||||||
'broccoli.js.cjs',
|
'broccoli.js.cjs',
|
||||||
['build/linknodemodules.js.cjs'],
|
['build/linknodemodules.js.cjs'],
|
||||||
'build/transformCJSTests',
|
|
||||||
done
|
done
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -159,6 +159,25 @@ function makeCjsTree() {
|
|||||||
modules: 'commonjs'
|
modules: 'commonjs'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Transform all tests to make them runnable in node
|
||||||
|
cjsTree = replace(cjsTree, {
|
||||||
|
files: ['**/test/**/*_spec.js'],
|
||||||
|
patterns: [
|
||||||
|
{
|
||||||
|
// Override the default DOM adapter with Parse5 for all tests
|
||||||
|
match: /"use strict";/,
|
||||||
|
replacement:
|
||||||
|
"'use strict'; var parse5Adapter = require('angular2/src/dom/parse5_adapter'); " +
|
||||||
|
"parse5Adapter.Parse5DomAdapter.makeCurrent();"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Append main() to all tests since all of our tests are wrapped in exported main fn
|
||||||
|
match: /$/g,
|
||||||
|
replacement: "\r\n main();"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
// Now we add the LICENSE file into all the folders that will become npm packages
|
// Now we add the LICENSE file into all the folders that will become npm packages
|
||||||
outputPackages.forEach(function(destDir) {
|
outputPackages.forEach(function(destDir) {
|
||||||
var license = new Funnel('.', {files: ['LICENSE'], destDir: destDir});
|
var license = new Funnel('.', {files: ['LICENSE'], destDir: destDir});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user