Skip to content

Commit

Permalink
fix(preprocessor): throw if retry fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ywongau committed May 24, 2017
1 parent 4b60513 commit 2789bf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var createPreprocessor = function (config, basePath, injector) {
fs.readFile(file.originalPath, handleFile)
return
} else {
done()
throw err
}
}

Expand Down
10 changes: 5 additions & 5 deletions test/unit/preprocessor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})

Expand Down

0 comments on commit 2789bf5

Please sign in to comment.