From a5513af69f5874babf33516bb365067282702f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bu=CC=80i=20Vie=CC=A3=CC=82t=20Tha=CC=80nh?= Date: Sat, 20 Apr 2019 17:43:10 +0700 Subject: [PATCH] https://github.com/qunitjs/qunit/issues/1389 --- package.json | 8 ++++---- qunit.patch | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 qunit.patch diff --git a/package.json b/package.json index 7b9846a4..e8ee8d60 100644 --- a/package.json +++ b/package.json @@ -35,18 +35,18 @@ "url": "https://github.com/ohze/rangy.git" }, "scripts": { - "clean": "rimraf dist", + "postinstall": "echo 'https://github.com/qunitjs/qunit/issues/1389' && patch -i qunit.patch node_modules/qunit/qunit/qunit.js", + "clean": "rimraf dist .rpt2_cache", "tsc:scripts": "tsc -b scripts/tsconfig.json", "tsc:src": "node $NODE_DEBUG_OPTION scripts/tsc.js", "tsc:test": "tsc -b test/", "dist-prepare": "node scripts/dist-prepare.js", "rollup:src": "rollup -c scripts/rollup.config.js", "rollup:test": "rollup -c scripts/rollup.config.test.js", - "prebuild": "yarn run tsc:scripts", "build:src": "npm-run-all tsc:src rollup:src", "build:test": "npm-run-all --parallel tsc:test rollup:test", - "build": "npm-run-all --parallel build:*", - "prerelease": "npm-run-all clean tsc:scripts --parallel build:* dist-prepare", + "build": "run-s tsc:scripts build:src build:test", + "prerelease": "run-s clean build dist-prepare", "release": "node scripts/publish.js", "watch:src": "TODO FORCE_COLOR=1 rollup -c --watch", "watch": "TODO run-p -l watch:types watch:js", diff --git a/qunit.patch b/qunit.patch new file mode 100644 index 00000000..0824eae4 --- /dev/null +++ b/qunit.patch @@ -0,0 +1,11 @@ +--- node_modules/qunit/qunit/qunit.orig.js 2019-04-13 13:02:25.000000000 +0700 ++++ node_modules/qunit/qunit/qunit.js 2019-04-20 12:10:07.000000000 +0700 +@@ -3996,7 +3996,7 @@ + expected = String(expected); + + // Expected is a constructor, maybe an Error constructor +- } else if (expectedType === "function" && actual instanceof expected) { ++ } else if (expectedType === "function" && expected.prototype !== undefined && actual instanceof expected) { + result = true; + + // Expected is an Error object