broccoli-sourcemap-concat
Advanced tools
Comparing version
@@ -55,3 +55,3 @@ var helpers = require('broccoli-kitchen-sink-helpers'); | ||
// multiGlob is obtuse. | ||
if (!error.message.match("did not match any files" || !this.allowNone)) { | ||
if (!error.message.match("did not match any files") || !this.allowNone) { | ||
throw error; | ||
@@ -58,0 +58,0 @@ } |
{ | ||
"name": "broccoli-sourcemap-concat", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Fast, good-enough concatenation with source maps.", | ||
@@ -16,3 +16,4 @@ "main": "index.js", | ||
"chai": "^1.10.0", | ||
"mocha": "^2.0.1" | ||
"mocha": "^2.0.1", | ||
"sinon": "^1.12.2" | ||
}, | ||
@@ -19,0 +20,0 @@ "dependencies": { |
@@ -53,3 +53,3 @@ var CachingWriter = require('broccoli-caching-writer'); | ||
// multiGlob is obtuse. | ||
if (!error.message.match("did not match any files" || !this.allowNone)) { | ||
if (!error.message.match("did not match any files") || !this.allowNone) { | ||
throw error; | ||
@@ -56,0 +56,0 @@ } |
/* global describe, afterEach, it, expect */ | ||
var expect = require('chai').expect; // jshint ignore:line | ||
var sinon = require('sinon'); | ||
var concat = require('..'); | ||
@@ -131,6 +132,6 @@ var RSVP = require('rsvp'); | ||
it('can ingore empty content', function() { | ||
it('can ignore empty content', function() { | ||
var tree = concat(fixtures, { | ||
outputFile: '/nothing.js', | ||
inputFiles: ['nothing/*.jsa'], | ||
inputFiles: ['nothing/*.js'], | ||
allowNone: true | ||
@@ -145,3 +146,3 @@ }); | ||
it('can ingore empty content when sourcemaps are disabled', function() { | ||
it('can ignore empty content when sourcemaps are disabled', function() { | ||
var tree = concat(fixtures, { | ||
@@ -158,2 +159,27 @@ outputFile: '/nothing.css', | ||
it('does not ignore empty content when allowNone is not explicitly set', function() { | ||
var tree = concat(fixtures, { | ||
outputFile: '/nothing.js', | ||
inputFiles: ['nothing/*.js'] | ||
}); | ||
var failure = sinon.spy(); | ||
builder = new broccoli.Builder(tree); | ||
return builder.build().catch(failure).then(function(){ | ||
expect(failure.called).to.be.true(); | ||
}); | ||
}); | ||
it('does not ignore empty content when allowNone is not explicitly set and sourcemaps are disabled', function() { | ||
var tree = concat(fixtures, { | ||
outputFile: '/nothing.css', | ||
inputFiles: ['nothing/*.css'] | ||
}); | ||
var failure = sinon.spy(); | ||
builder = new broccoli.Builder(tree); | ||
return builder.build().catch(failure).then(function(){ | ||
expect(failure.called).to.be.true(); | ||
}); | ||
}); | ||
afterEach(function() { | ||
@@ -160,0 +186,0 @@ if (builder) { |
21246
4.22%514
4.68%5
25%