Transpile sources for testing
This commit is contained in:
@@ -35,6 +35,8 @@ class AssertionError extends Error {
|
||||
*/
|
||||
this.name = 'AssertionError';
|
||||
|
||||
// Re-assign message, see https://github.com/Rich-Harris/buble/issues/40
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,7 +60,17 @@ module.exports = function(karma) {
|
||||
reporters: ['progress'],
|
||||
webpack: {
|
||||
devtool: 'inline-source-map',
|
||||
mode: 'development'
|
||||
mode: 'development',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: {
|
||||
loader: 'buble-loader'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
webpackMiddleware: {
|
||||
noInfo: true
|
||||
|
||||
@@ -22,4 +22,11 @@ describe('ol.AssertionError', function() {
|
||||
const error = new AssertionError(42);
|
||||
expect(error.name).to.be('AssertionError');
|
||||
});
|
||||
|
||||
it('is instanceof Error and AssertionError', function() {
|
||||
const error = new AssertionError(42);
|
||||
expect(error instanceof Error).to.be(true);
|
||||
expect(error instanceof AssertionError).to.be(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user