Skip to content

Commit

Permalink
fix(init): issue computmaxer#162
Browse files Browse the repository at this point in the history
  • Loading branch information
m-a-r-c-e-l-i-n-o committed Jul 9, 2016
1 parent 284ccd9 commit d0aa8c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ module.exports = function(files, basePath, jspm, client, emitter) {
return packagesPath + fileName + '.js';
}
}

Array.prototype.unshift.apply(files,
configPaths.map(function(configPath) {
return createPattern(configPath)
})
);

// Needed for JSPM 0.17 beta
if(jspm.browser) {
files.unshift(createPattern(browserPath));
Expand Down Expand Up @@ -139,7 +139,9 @@ module.exports = function(files, basePath, jspm, client, emitter) {

// Allow Karma to serve all files within jspm_packages.
// This allows jspm/SystemJS to load them
var jspmPattern = createServedPattern(packagesPath + '**/*', {nocache: jspm.cachePackages !== true});
var jspmPattern = createServedPattern(
packagesPath + '!(system-polyfills.src.js|system.src.js)/**', {nocache: jspm.cachePackages !== true}
);
jspmPattern.watched = false;
files.push(jspmPattern);
};
2 changes: 1 addition & 1 deletion test/testInit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('jspm plugin init', function(){
});

it('should use the configured jspm_packages path and include it at the end of the files array', function(){
expect(normalPath(files[files.length - 1].pattern)).toEqual(normalPath(path.resolve(cwd, './custom_packages/**/*')));
expect(normalPath(files[files.length - 1].pattern)).toEqual(normalPath(path.resolve(cwd, './custom_packages/!(system-polyfills.src.js|system.src.js)/**')));
expect(files[files.length - 1].included).toEqual(false);
expect(files[files.length - 1].served).toEqual(true);
expect(files[files.length - 1].watched).toEqual(false);
Expand Down

0 comments on commit d0aa8c4

Please sign in to comment.