├── .eslintrc ├── .gitignore ├── .travis.yml ├── LICENSE ├── NOTICE ├── README.md ├── index.js ├── package.json ├── src ├── adapter.js └── init.js └── test ├── jasmine.json └── testInit.spec.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "indent": [ 4 | 2, 5 | 4 6 | ], 7 | "quotes": [ 8 | 2, 9 | "single" 10 | ], 11 | "linebreak-style": [ 12 | 2, 13 | "unix" 14 | ], 15 | "semi": [ 16 | 2, 17 | "always" 18 | ] 19 | }, 20 | "env": { 21 | "node": true 22 | }, 23 | "extends": "eslint:recommended" 24 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014-2015 Workiva Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | karma-jspm 2 | Copyright 2014-2015 Workiva Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # karma-jspm [![Build Status](https://travis-ci.org/Workiva/karma-jspm.svg?branch=master)](https://travis-ci.org/Workiva/karma-jspm) 2 | 3 | karma-jspm includes the jspm module loader for karma runs. This allows dynamic loading of src/test files and modules. No longer do you need to worry about browserifying your src or tests before every test run! 4 | 5 | ##Installation## 6 | 7 | Available in npm: `npm install karma-jspm --save-dev` 8 | 9 | **This plugin assumes you are using jspm in your project.** You will need to have a `config.js` in the root of your project (though this is configurable) as well as a `jspm_packages` directory containing systemjs and the es6-module-loader. 10 | 11 | **This plugin can now support JSPM 0.17 beta** 12 | ##Configuration## 13 | 14 | *karma.conf.js* 15 | 16 | Include this plugin in your frameworks: 17 | 18 | ```js 19 | frameworks: ['jspm', 'jasmine'], 20 | ``` 21 | 22 | Karma auto loads plugins unless you specify a plugins config. If you have one, you'll also need to add it there: 23 | 24 | ```js 25 | plugins: ['karma-jspm', 'karma-phantomjs-launcher'], 26 | ``` 27 | 28 | The `loadFiles` configuration tells karma-jspm which files should be dynamically loaded via systemjs *before* the tests run. Globs or regular file paths are acceptable. 29 | 30 | 31 | **You should not include these in the regular karma files array.** karma-jspm takes care of this for you. 32 | 33 | ```js 34 | jspm: { 35 | // Edit this to your needs 36 | loadFiles: ['src/**/*.js', 'test/**/*.js'] 37 | } 38 | ``` 39 | 40 | That's it! 41 | 42 | 43 | ###Optional Configuration### 44 | 45 | You may have named your jspm `config.js` file or `jspm_packages` directory something else. In this case simply add that to the jspm configuration in *karma.conf.js*: 46 | 47 | ```js 48 | jspm: { 49 | config: "myJspmConfig.js", 50 | packages: "my_jspm_modules/" 51 | } 52 | ``` 53 | 54 | For JSPM 0.17 Beta, you have to specify the `jspm.browser.js` file. 55 | 56 | ```js 57 | jspm: { 58 | browser: "myJspmBrowser.js", 59 | } 60 | ``` 61 | 62 | If you use jspm 0.17 beta >33 and are running tests in a browser without native Promise support (like phantomjs <2.5), you can load a polyfill by adding your file(s) 63 | in beforeFiles. For example, install babel-polyfill with `npm install --save-dev babel-polyfill` and then add the line below to the karma config: 64 | 65 | ```js 66 | jspm: { 67 | beforeFiles: ['node_modules/babel-polyfill/dist/polyfill.js'] 68 | } 69 | ``` 70 | 71 | You may want to make additional files/a file pattern available for jspm to load, but not load it right away. Simply add that to `serveFiles`. 72 | One use case for this is to only put test specs in `loadFiles`, and jspm will only load the src files when and if the test files require them. Such a config would look like this: 73 | 74 | ```js 75 | jspm: { 76 | loadFiles: ['test/**/*.js'], 77 | serveFiles: ['src/**/*.js'] 78 | } 79 | ``` 80 | 81 | By default karma-jspm ignores jspm's bundles configuration. To re-enable it, specify the `useBundles` option. 82 | 83 | ```js 84 | jspm: { 85 | useBundles: true 86 | } 87 | ``` 88 | 89 | Depending on your framework and project structure it might be necessary to override jspm paths for the testing scenario. 90 | In order to do so just add the `paths` property to the jspm config object in your karma-configuration file, along with the overrides: 91 | 92 | ```js 93 | jspm: { 94 | paths: { 95 | '*': 'yourpath/*.js', 96 | ... 97 | } 98 | } 99 | ``` 100 | 101 | By default the plugin will strip the file extension of the js files. To disable that, specify the `stripExtension` option: 102 | 103 | ```js 104 | jspm: { 105 | stripExtension: false 106 | } 107 | ``` 108 | 109 | Most of the time, you do not want to cache your entire jspm_packages directory, but serve it from the disk. This is done by default, but can be reversed as follows: 110 | 111 | ```js 112 | jspm: { 113 | cachePackages: true 114 | } 115 | ``` 116 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2015 Workiva Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | var initJspm = require('./src/init'); 18 | 19 | initJspm.$inject = ['config.files', 'config.basePath', 'config.jspm', 'config.client', 'emitter']; 20 | 21 | module.exports = { 22 | 'framework:jspm': ['factory', initJspm] 23 | }; 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "karma-jspm", 3 | "version": "2.2.3", 4 | "description": "Include jspm module loader for karma runs; allows dynamic loading of src and test files and modules", 5 | "main": "index.js", 6 | "keywords": [ 7 | "karma-plugin", 8 | "karma-adapter", 9 | "jspm" 10 | ], 11 | "scripts": { 12 | "test": "cross-env JASMINE_CONFIG_PATH=test/jasmine.json jasmine 'test/**/*.spec.js'", 13 | "lint": "eslint **/*.js" 14 | }, 15 | "author": { 16 | "name": "Max Peterson", 17 | "email": "maxwell.peterson@workiva.com" 18 | }, 19 | "contributors": [ 20 | { 21 | "name": "Max Peterson", 22 | "email": "computmaxer@gmail.com" 23 | } 24 | ], 25 | "license": "Apache-2.0", 26 | "repository": { 27 | "type": "git", 28 | "url": "git@github.com:Workiva/karma-jspm.git" 29 | }, 30 | "dependencies": { 31 | "glob": "~7.0.5" 32 | }, 33 | "devDependencies": { 34 | "cross-env": "^1.0.7", 35 | "eslint": "^2.10.2", 36 | "jasmine": "^2.4.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/adapter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2015 Workiva Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /*eslint-env browser*/ 18 | /*global Promise*/ 19 | 20 | (function (karma, System) { 21 | if (!System) { 22 | throw new Error('SystemJS was not found. Please make sure you have ' + 23 | 'initialized jspm via installing a dependency with jspm, ' + 24 | 'or by running \'jspm dl-loader\'.'); 25 | } 26 | 27 | System.config({baseURL: 'base'}); 28 | 29 | var stripExtension = typeof karma.config.jspm.stripExtension === 'boolean' ? karma.config.jspm.stripExtension : true; 30 | 31 | // Prevent immediately starting tests. 32 | karma.loaded = function () { 33 | 34 | if (karma.config.jspm.paths !== undefined && 35 | typeof karma.config.jspm.paths === 'object') { 36 | 37 | System.config({ 38 | paths: karma.config.jspm.paths 39 | }); 40 | } 41 | 42 | if (karma.config.jspm.meta !== undefined && 43 | typeof karma.config.jspm.meta === 'object') { 44 | System.config({ 45 | meta: karma.config.jspm.meta 46 | }); 47 | } 48 | 49 | if (karma.config.jspm.map !== undefined && typeof karma.config.jspm.map === 'object') { 50 | System.config({ 51 | map: karma.config.jspm.map 52 | }); 53 | } 54 | 55 | // Exclude bundle configurations if useBundles option is not specified 56 | if (!karma.config.jspm.useBundles) { 57 | System.config({ bundles: [] }); 58 | } 59 | 60 | // Load everything specified in loadFiles in the specified order 61 | var promiseChain = Promise.resolve(); 62 | for (var i = 0; i < karma.config.jspm.expandedFiles.length; i++) { 63 | promiseChain = promiseChain.then((function (moduleName) { 64 | return function () { 65 | return System['import'](moduleName); 66 | }; 67 | })(extractModuleName(karma.config.jspm.expandedFiles[i]))); 68 | } 69 | 70 | promiseChain.then(function () { 71 | karma.start(); 72 | }, function (e) { 73 | karma.error(e.name + ': ' + e.message); 74 | }); 75 | }; 76 | 77 | function extractModuleName(fileName) { 78 | if (stripExtension) { 79 | return fileName.replace(/\.js$/, ''); 80 | } 81 | return fileName; 82 | } 83 | })(window.__karma__, window.System); 84 | -------------------------------------------------------------------------------- /src/init.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2015 Workiva Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | var glob = require('glob'); 18 | var path = require('path'); 19 | var fs = require('fs'); 20 | 21 | 22 | function flatten(structure) { 23 | return [].concat.apply([], structure); 24 | } 25 | 26 | function expandGlob(file, cwd) { 27 | return glob.sync(file.pattern || file, {cwd: cwd}); 28 | } 29 | 30 | var createPattern = function (path) { 31 | return {pattern: path, included: true, served: true, watched: false}; 32 | }; 33 | 34 | var createServedPattern = function(path, file){ 35 | return { 36 | pattern: path, 37 | included: file && 'included' in file ? file.included : false, 38 | served: file && 'served' in file ? file.served : true, 39 | nocache: file && 'nocache' in file ? file.nocache : false, 40 | watched: file && 'watched' in file ? file.watched : true 41 | }; 42 | }; 43 | 44 | function getJspmPackageJson(dir) { 45 | var pjson = {}; 46 | try { 47 | pjson = JSON.parse(fs.readFileSync(path.resolve(dir, 'package.json'))); 48 | } 49 | catch (e) { 50 | pjson = {}; 51 | } 52 | if (pjson.jspm) { 53 | for (var p in pjson.jspm) 54 | pjson[p] = pjson.jspm[p]; 55 | } 56 | pjson.directories = pjson.directories || {}; 57 | if (pjson.directories.baseURL) { 58 | if (!pjson.directories.packages) 59 | pjson.directories.packages = path.join(pjson.directories.baseURL, 'jspm_packages'); 60 | if (!pjson.configFile) 61 | pjson.configFile = path.join(pjson.directories.baseURL, 'config.js'); 62 | } 63 | return pjson; 64 | } 65 | 66 | module.exports = function(files, basePath, jspm, client, emitter) { 67 | // Initialize jspm config if it wasn't specified in karma.conf.js 68 | if(!jspm) 69 | jspm = {}; 70 | if(!jspm.config) 71 | jspm.config = getJspmPackageJson(basePath).configFile || 'config.js'; 72 | if(!jspm.beforeFiles) 73 | jspm.beforeFiles = []; 74 | if(!jspm.loadFiles) 75 | jspm.loadFiles = []; 76 | if(!jspm.serveFiles) 77 | jspm.serveFiles = []; 78 | if(!jspm.packages) 79 | jspm.packages = getJspmPackageJson(basePath).directories.packages || 'jspm_packages/'; 80 | if(!client.jspm) 81 | client.jspm = {}; 82 | if(jspm.paths !== undefined && typeof jspm.paths === 'object') 83 | client.jspm.paths = jspm.paths; 84 | if(jspm.meta !== undefined && typeof jspm.meta === 'object') 85 | client.jspm.meta = jspm.meta; 86 | if(jspm.map !== undefined && typeof jspm.map === 'object') 87 | client.jspm.map = jspm.map; 88 | 89 | // Pass on options to client 90 | client.jspm.useBundles = jspm.useBundles; 91 | client.jspm.stripExtension = jspm.stripExtension; 92 | 93 | var packagesPath = path.normalize(basePath + '/' + jspm.packages + '/'); 94 | var browserPath = path.normalize(basePath + '/' + jspm.browser); 95 | var configFiles = Array.isArray(jspm.config) ? jspm.config : [jspm.config]; 96 | var configPaths = configFiles.map(function(config) { 97 | return path.normalize(basePath + '/' + config); 98 | }); 99 | 100 | // Add SystemJS loader and jspm config 101 | function getLoaderPath(fileName){ 102 | var exists = glob.sync(packagesPath + fileName + '@*.js'); 103 | if(exists && exists.length != 0){ 104 | return packagesPath + fileName + '@*.js'; 105 | } else { 106 | return packagesPath + fileName + '.js'; 107 | } 108 | } 109 | 110 | Array.prototype.unshift.apply(files, 111 | configPaths.map(function(configPath) { 112 | return createPattern(configPath); 113 | }) 114 | ); 115 | 116 | // Needed for JSPM 0.17 beta 117 | if(jspm.browser) { 118 | files.unshift(createPattern(browserPath)); 119 | } 120 | 121 | 122 | files.unshift(createPattern(__dirname + '/adapter.js')); 123 | 124 | var polyfillsFile = getLoaderPath('system-polyfills.src'); 125 | if(fs.existsSync(polyfillsFile)) { 126 | files.unshift(createPattern(getLoaderPath('system-polyfills.src'))); 127 | } else { 128 | console.warn('No system-polyfills present. If the browser does not support Promises, you may need to load a polyfill with jspm.beforeFiles'); //eslint-disable-line no-console 129 | } 130 | 131 | files.unshift(createPattern(getLoaderPath('system.src'))); 132 | 133 | // Load beforeFiles to the beginning of the files array. Iterate 134 | // through the array in reverse to preserve the order 135 | jspm.beforeFiles.reverse().forEach(function(file) { 136 | files.unshift(createPattern(basePath + '/' + (file.pattern || file))); 137 | }); 138 | 139 | // Loop through all of jspm.load_files and do two things 140 | // 1. Add all the files as "served" files to the files array 141 | // 2. Expand out and globs to end up with actual files for jspm to load. 142 | // Store that in client.jspm.expandedFiles 143 | function addExpandedFiles() { 144 | client.jspm.expandedFiles = flatten(jspm.loadFiles.map(function (file) { 145 | files.push(createServedPattern(basePath + '/' + (file.pattern || file), typeof file !== 'string' ? file : null)); 146 | return expandGlob(file, basePath); 147 | })); 148 | } 149 | addExpandedFiles(); 150 | 151 | emitter.on('file_list_modified', addExpandedFiles); 152 | 153 | // Add served files to files array 154 | jspm.serveFiles.map(function(file){ 155 | files.push(createServedPattern(basePath + '/' + (file.pattern || file))); 156 | }); 157 | 158 | // Allow Karma to serve all files within jspm_packages. 159 | // This allows jspm/SystemJS to load them 160 | var jspmPattern = createServedPattern( 161 | packagesPath + '!(system-polyfills.src.js|system.src.js)/**', {nocache: jspm.cachePackages !== true} 162 | ); 163 | jspmPattern.watched = false; 164 | files.push(jspmPattern); 165 | }; 166 | -------------------------------------------------------------------------------- /test/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "test", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": false 8 | } 9 | -------------------------------------------------------------------------------- /test/testInit.spec.js: -------------------------------------------------------------------------------- 1 | /*global describe, expect, it, beforeEach, spyOn*/ 2 | 3 | var cwd = process.cwd(); 4 | var fs = require('fs'); 5 | var path = require('path'); 6 | var initJspm = require('../src/init'); 7 | 8 | var normalPath = function(path){ 9 | return path.replace(/\\/g,'/'); 10 | }; 11 | 12 | describe('jspm plugin init', function(){ 13 | var files, jspm, client, emitter; 14 | var basePath = path.resolve(__dirname, '..'); 15 | 16 | beforeEach(function(){ 17 | spyOn(fs, 'existsSync').and.returnValue(true); 18 | files = []; 19 | jspm = { 20 | browser: 'custom_browser.js', 21 | config: 'custom_config.js', 22 | loadFiles: ['src/**/*.js',{pattern:'not-cached.js', nocache:true}, {pattern:'not-watched.js', watched:false}], 23 | packages: 'custom_packages/', 24 | serveFiles: ['testfile.js'] 25 | }; 26 | client = {}; 27 | emitter = { 28 | on: function() {} 29 | }; 30 | 31 | initJspm(files, basePath, jspm, client, emitter); 32 | }); 33 | 34 | it('should add config.js to the top of the files array', function(){ 35 | expect(normalPath(files[4].pattern)).toEqual(normalPath(basePath + '/custom_config.js')); 36 | expect(files[4].included).toEqual(true); 37 | }); 38 | 39 | it('should add browser.js to the top of the files array', function(){ 40 | expect(normalPath(files[3].pattern)).toEqual(normalPath(basePath + '/custom_browser.js')); 41 | expect(files[3].included).toEqual(true); 42 | }); 43 | 44 | it('should support an array of config files', function() { 45 | jspm.config = ['custom_config.js', 'another_config.js']; 46 | files = []; 47 | initJspm(files, basePath, jspm, client, emitter); 48 | expect(normalPath(files[4].pattern)).toEqual(normalPath(basePath + '/custom_config.js')); 49 | expect(normalPath(files[5].pattern)).toEqual(normalPath(basePath + '/another_config.js')); 50 | }); 51 | 52 | it('should add adapter.js to the top of the files array', function(){ 53 | expect(normalPath(files[2].pattern)).toEqual(normalPath(basePath + '/src/adapter.js')); 54 | expect(files[2].included).toEqual(true); 55 | }); 56 | 57 | it('should add systemjs-polyfills to the top of the files array', function(){ 58 | expect(normalPath(files[1].pattern)).toEqual(normalPath(basePath + '/custom_packages/system-polyfills.src.js')); 59 | expect(files[1].included).toEqual(true); 60 | }); 61 | 62 | it('should not add systemjs-polyfills to the top of the files array if it does not exist', function(){ 63 | fs.existsSync.and.returnValue(false); 64 | initJspm(files, basePath, jspm, client, emitter); 65 | expect(normalPath(files[1].pattern)).not.toEqual(normalPath(basePath + '/custom_packages/system-polyfills.src.js')); 66 | expect(files[1].included).toEqual(true); 67 | }); 68 | 69 | it('should add systemjs to the top of the files array', function(){ 70 | expect(normalPath(files[0].pattern)).toEqual(normalPath(basePath + '/custom_packages/system.src.js')); 71 | expect(files[0].included).toEqual(true); 72 | }); 73 | 74 | it('should add files from jspm.beforeFiles to the beginning of the files array', function() { 75 | jspm.beforeFiles = ['node_modules/promise-polyfill.js', 'other-polyfill.js']; 76 | initJspm(files, basePath, jspm, client, emitter); 77 | expect(normalPath(files[0].pattern)).toEqual(normalPath(basePath + '/node_modules/promise-polyfill.js')); 78 | expect(files[0].included).toEqual(true); 79 | expect(normalPath(files[1].pattern)).toEqual(normalPath(basePath + '/other-polyfill.js')); 80 | expect(files[1].included).toEqual(true); 81 | }); 82 | 83 | 84 | it('should add files from jspm.loadFiles to client.expandedFiles', function(){ 85 | expect(client.jspm.expandedFiles).toEqual(['src/adapter.js', 'src/init.js']); 86 | }); 87 | 88 | it('should add files from jspm.serveFiles to the files array as served files', function(){ 89 | expect(normalPath(files[files.length - 2].pattern)).toEqual(normalPath(cwd + '/testfile.js')); 90 | expect(files[files.length - 2].included).toEqual(false); 91 | expect(files[files.length - 2].served).toEqual(true); 92 | expect(files[files.length - 2].watched).toEqual(true); 93 | }); 94 | 95 | it('should use the configured jspm_packages path and include it at the end of the files array', function(){ 96 | expect(normalPath(files[files.length - 1].pattern)).toEqual(normalPath(path.resolve(cwd, './custom_packages/!(system-polyfills.src.js|system.src.js)/**'))); 97 | expect(files[files.length - 1].included).toEqual(false); 98 | expect(files[files.length - 1].served).toEqual(true); 99 | expect(files[files.length - 1].watched).toEqual(false); 100 | }); 101 | 102 | it('should assign true to nocache option to served files with nocache option in jspm.loadFiles', function(){ 103 | expect(normalPath(files[files.length - 4].pattern)).toEqual(normalPath(cwd + '/not-cached.js')); 104 | expect(files[files.length - 4].included).toEqual(false); 105 | expect(files[files.length - 4].served).toEqual(true); 106 | expect(files[files.length - 4].watched).toEqual(true); 107 | expect(files[files.length - 4].nocache).toEqual(true); 108 | }); 109 | 110 | it('should respect watched flag when adding jspm.loadFiles to served files', function(){ 111 | expect(normalPath(files[files.length - 3].pattern)).toEqual(normalPath(cwd + '/not-watched.js')); 112 | expect(files[files.length - 3].included).toEqual(false); 113 | expect(files[files.length - 3].served).toEqual(true); 114 | expect(files[files.length - 3].watched).toEqual(false); 115 | expect(files[files.length - 3].nocache).toEqual(false); 116 | }); 117 | }); 118 | --------------------------------------------------------------------------------