Merge pull request #297 from strongloop/fix/ci
test: fix browserify-based tests
This commit is contained in:
commit
0bbe8335a4
|
@ -8,6 +8,7 @@
|
|||
var boot = require('../');
|
||||
var async = require('async');
|
||||
var exportBrowserifyToFile = require('./helpers/browserify').exportToSandbox;
|
||||
var packageFilter = require('./helpers/browserify').packageFilter;
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var expect = require('chai').expect;
|
||||
|
@ -66,6 +67,7 @@ function browserifyTestApps(apps, next) {
|
|||
var b = browserify({
|
||||
debug: true,
|
||||
basedir: path.resolve(__dirname, './fixtures'),
|
||||
packageFilter,
|
||||
});
|
||||
|
||||
var bundles = [];
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
var boot = require('../');
|
||||
var exportBrowserifyToFile = require('./helpers/browserify').exportToSandbox;
|
||||
var packageFilter = require('./helpers/browserify').packageFilter;
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var expect = require('chai').expect;
|
||||
|
@ -21,6 +22,7 @@ var compileStrategies = {
|
|||
var b = browserify({
|
||||
basedir: appDir,
|
||||
debug: true,
|
||||
packageFilter,
|
||||
});
|
||||
b.require('./app.js', {expose: 'browser-app'});
|
||||
return b;
|
||||
|
@ -31,6 +33,7 @@ var compileStrategies = {
|
|||
basedir: appDir,
|
||||
extensions: ['.coffee'],
|
||||
debug: true,
|
||||
packageFilter,
|
||||
});
|
||||
b.transform('coffeeify');
|
||||
|
||||
|
|
|
@ -21,3 +21,16 @@ function exportToSandbox(b, fileName, callback) {
|
|||
});
|
||||
}
|
||||
exports.exportToSandbox = exportToSandbox;
|
||||
|
||||
exports.packageFilter = function packageFilter(pkg, dir) {
|
||||
// async@3 (used e.g. by loopback-connector) is specifying custom
|
||||
// browserify config, in particular it wants to apply transformation
|
||||
// `babelify`. We don't have `babelify` installed because we are
|
||||
// testing using latest Chrome and thus don't need any transpilation.
|
||||
// Let's remove the browserify config from the package and force
|
||||
// browserify to use our config instead.
|
||||
if (pkg.name === 'async') {
|
||||
delete pkg.browserify;
|
||||
}
|
||||
return pkg;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue