diff --git a/lib/preprocessor.js b/lib/preprocessor.js index 8111491bf..0101c9bb6 100644 --- a/lib/preprocessor.js +++ b/lib/preprocessor.js @@ -86,7 +86,7 @@ var createPreprocessor = function (config, basePath, injector) { fs.readFile(file.originalPath, handleFile) return } else { - done() + throw err } } diff --git a/test/unit/preprocessor.spec.js b/test/unit/preprocessor.spec.js index 0336308fe..591483251 100644 --- a/test/unit/preprocessor.spec.js +++ b/test/unit/preprocessor.spec.js @@ -261,19 +261,19 @@ describe('preprocessor', () => { thirdCallback('error') }) - it('should abort after 3 retries', (done) => { + it('should tbrow after 3 retries', (done) => { var injector = new di.Injector([{}, emitterSetting]) var pp = m.createPreprocessor({'**/*.js': []}, null, injector) - pp(file, () => { - done() - }) + pp(file, () => { }) getReadFileCallback(0)('error') getReadFileCallback(1)('error') getReadFileCallback(2)('error') - getReadFileCallback(3)('error') + + expect(() => getReadFileCallback(0)('error')).to.throw('error') + done() }) })