diff --git a/.gitignore b/.gitignore index 3c3629e..d2fe157 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ +.idea +*.iml + node_modules diff --git a/.travis.yml b/.travis.yml index c86a73a..959c8a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - npm install -g grunt-cli + - npm install karma-firefox-launcher - ln -s .. node_modules/karma-closure script: diff --git a/lib/plugin.js b/lib/plugin.js index 85de9a4..22bcb47 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -10,41 +10,39 @@ var initClosureDependencyResolver = function(emitter, fileList, resolver, iit, f }); // whenever file list changes, resolve the deps - update files.included - emitter.on('file_list_modified', function(promise) { - promise.then(function(files) { - var includedPaths = files.included.map(function(file) { - return file.originalPath; - }); - - if (iit.isInclusive()) { - includedPaths = includedPaths.filter(iit.filter); - } + emitter.on('file_list_modified', function(files) { + var includedPaths = files.included.map(function(file) { + return file.originalPath; + }); - var resolvedPaths = resolver.resolveFiles(includedPaths); - var servedFiles = files.served; + if (iit.isInclusive()) { + includedPaths = includedPaths.filter(iit.filter); + } - // TODO(vojta): change files.served to be a map, rather than an array - files.included = resolvedPaths.map(function(filepath) { - for (var i = 0, length = servedFiles.length; i < length; i++) { - if (servedFiles[i].originalPath === filepath) { - return servedFiles[i]; - } + var resolvedPaths = resolver.resolveFiles(includedPaths); + var servedFiles = files.served; + + // TODO(vojta): change files.served to be a map, rather than an array + files.included = resolvedPaths.map(function(filepath) { + for (var i = 0, length = servedFiles.length; i < length; i++) { + if (servedFiles[i].originalPath === filepath) { + return servedFiles[i]; } + } - console.error('NOT SERVED FILE', filepath); - var externalFile = { - path: filepath, - originalPath: filepath, - contentPath: filepath, - isUrl: false, - // TODO(vojta): cache mtime and restat when deps.js changes ? - // TODO(votja): use the last synced CL number in google3 ? - mtime: new Date() - }; - - files.served.push(externalFile); - return externalFile; - }); + console.error('NOT SERVED FILE', filepath); + var externalFile = { + path: filepath, + originalPath: filepath, + contentPath: filepath, + isUrl: false, + // TODO(vojta): cache mtime and restat when deps.js changes ? + // TODO(votja): use the last synced CL number in google3 ? + mtime: new Date() + }; + + files.served.push(externalFile); + return externalFile; }); }); diff --git a/package.json b/package.json index 02a9aa5..e53260c 100644 --- a/package.json +++ b/package.json @@ -25,12 +25,12 @@ "grunt-coffeelint": "~0.0.6", "grunt-contrib-jshint": "~0.6.0", "grunt-simple-mocha": "~0.4.0", - "karma": "~0.9.4", - "karma-jasmine": "~0.0.1", + "karma": "~0.13", + "karma-jasmine": "~0.3", "grunt-auto-release": "~0.0.3" }, "peerDependencies": { - "karma": ">=0.9" + "karma": ">=0.13" }, "license": "MIT", "contributors": [