Skip to content
Snippets Groups Projects
Unverified Commit 287ed6da authored by Tom Robinson's avatar Tom Robinson
Browse files

Ensure subclasses of Error work with instanceof. Resolves #4209

parent 3fc1ee43
Branches
Tags
No related merge requests found
{
"plugins": ["transform-flow-strip-types", "add-react-displayname", "transform-decorators-legacy"],
"plugins": [
"transform-flow-strip-types",
"add-react-displayname",
"transform-decorators-legacy",
["babel-plugin-transform-builtin-extend", {
"globals": ["Error", "Array"]
}]
],
"presets": ["es2015", "stage-0", "react"],
"env": {
"development": {
......
import { MinRowsError } from 'metabase/visualizations/lib/errors';
describe('MinRowsError', () => {
it("should be an instanceof Error", () => {
expect(new MinRowsError(1, 0) instanceof Error).toBe(true);
});
it("should be an instanceof MinRowsError", () => {
expect(new MinRowsError(1, 0) instanceof MinRowsError).toBe(true);
});
});
......@@ -739,6 +739,13 @@ babel-plugin-transform-async-to-generator@^6.16.0, babel-plugin-transform-async-
babel-plugin-syntax-async-functions "^6.8.0"
babel-runtime "^6.0.0"
babel-plugin-transform-builtin-extend@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-builtin-extend/-/babel-plugin-transform-builtin-extend-1.1.2.tgz#5e96fecf58b8fa1ed74efcad88475b2af3c9116e"
dependencies:
babel-runtime "^6.2.0"
babel-template "^6.3.0"
babel-plugin-transform-class-constructor-call@^6.3.13:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.18.0.tgz#80855e38a1ab47b8c6c647f8ea1bcd2c00ca3aae"
......@@ -6054,10 +6061,6 @@ resize-observer-polyfill@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.3.2.tgz#f467efc15a86d9ee5096fd6d7f628c8a54bb805a"
resize-observer-polyfill@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.3.2.tgz#f467efc15a86d9ee5096fd6d7f628c8a54bb805a"
resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment