-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pass on error to callback for better error messages (#262)
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {assert} from 'chai' | ||
import {webpackPlugin} from '../../src/karma-webpack' | ||
|
||
describe('Plugin', function() { | ||
describe('#make()', function() { | ||
it('should pass through error from compilation', function(done) { | ||
var emitterMock = { | ||
on() {} | ||
} | ||
var compilationMock = { | ||
addEntry(name, dep, file, cb) { | ||
cb(new Error('test error')) | ||
} | ||
} | ||
var Plugin = new webpackPlugin[1]({}, {}, {}, '', [], [], [], emitterMock) | ||
|
||
Plugin.addFile('test.js') | ||
Plugin.make(compilationMock, function(err) { | ||
assert.equal(err.message, 'test error') | ||
done() | ||
}) | ||
}) | ||
}) | ||
}) |