Transpile sources for testing
This commit is contained in:
@@ -35,6 +35,8 @@ class AssertionError extends Error {
|
|||||||
*/
|
*/
|
||||||
this.name = 'AssertionError';
|
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'],
|
reporters: ['progress'],
|
||||||
webpack: {
|
webpack: {
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
mode: 'development'
|
mode: 'development',
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
use: {
|
||||||
|
loader: 'buble-loader'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
webpackMiddleware: {
|
webpackMiddleware: {
|
||||||
noInfo: true
|
noInfo: true
|
||||||
|
|||||||
@@ -22,4 +22,11 @@ describe('ol.AssertionError', function() {
|
|||||||
const error = new AssertionError(42);
|
const error = new AssertionError(42);
|
||||||
expect(error.name).to.be('AssertionError');
|
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