fix tests

This commit is contained in:
Anton Lavrenov 2021-05-04 09:33:41 -05:00
parent 7a6613118e
commit cb20f00e4b
3 changed files with 7 additions and 5 deletions

View File

@ -19,11 +19,11 @@
"lint": "gulp lint", "lint": "gulp lint",
"build": "npm run compile && gulp build", "build": "npm run compile && gulp build",
"full-build": "npm run build && npm t", "full-build": "npm run build && npm t",
"test": "node ./test/import-test.js && npm run test:build && mocha-headless-chrome -f ./test-build/unit-tests.html -a disable-web-security && npm run test:types", "test": "node ./test/import-test.js && npm run test:browser && npm run test:node",
"test:node": "env TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha -r ts-node/register test/unit/**/*.ts",
"test:build": "parcel build ./test/unit-tests.html --dist-dir test-build --target none --public-url ./ --no-source-maps", "test:build": "parcel build ./test/unit-tests.html --dist-dir test-build --target none --public-url ./ --no-source-maps",
"test:browser": "npm run test:build && mocha-headless-chrome -f ./test-build/unit-tests.html -a disable-web-security",
"test:node": "env TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha -r ts-node/register test/unit/**/*.ts",
"test:watch": "rm -rf ./parcel-cache && parcel serve ./test/unit-tests.html ./test/manual-tests.html ./test/performance/bunnies.html", "test:watch": "rm -rf ./parcel-cache && parcel serve ./test/unit-tests.html ./test/manual-tests.html ./test/performance/bunnies.html",
"prettier": "prettier --write \"src/**/*.js\" \"test/**/*.js\" --single-quote",
"tsc": "tsc --removeComments", "tsc": "tsc --removeComments",
"rollup": "rollup -c", "rollup": "rollup -c",
"clean": "rm -rf ./lib && rm -rf ./types && rm -rf ./es", "clean": "rm -rf ./lib && rm -rf ./types && rm -rf ./es",

View File

@ -105,7 +105,7 @@ describe('AutoDraw', function () {
it('redraw for images', function (done) { it('redraw for images', function (done) {
// don't test on node, because of specific url access // don't test on node, because of specific url access
if (isNode) { if (isNode) {
return; return done();
} }
var stage = addStage(); var stage = addStage();
var layer = new Konva.Layer(); var layer = new Konva.Layer();

View File

@ -3762,8 +3762,10 @@ describe('Node', function () {
}); });
it('show warning when we are trying to use non-objects for component setters', function () { it('show warning when we are trying to use non-objects for component setters', function () {
if (!Konva.isUnminified) {
return;
}
var stage = addStage(); var stage = addStage();
var callCount = 0; var callCount = 0;
var oldWarn = Konva.Util.warn; var oldWarn = Konva.Util.warn;
Konva.Util.warn = function () { Konva.Util.warn = function () {