Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brugarolas committed Aug 12, 2020
1 parent a3b2a75 commit 7911f66
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 267 deletions.
23 changes: 19 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"eslint-config-canonical": "^22.0.0",
"husky": "^4.2.5",
"raf": "^3.4.1",
"mocha": "^8.1.1",
"chai": "^4.2.0",
"jsdom": "^16.4.0",
"ava": "^3.11.1",
"@ava/babel": "^1.0.1",
"browser-env": "^3.3.0",
"sinon": "^9.0.2"
},
"keywords": [
Expand All @@ -52,11 +52,26 @@
"scripts": {
"build": "babel ./src --out-dir ./dist --copy-files",
"lint": "eslint ./src ./test",
"test": "mocha --require @babel/register --exit"
"test": "ava --verbose --serial",
"test:debug": "ava debug --verbose --serial"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint && npm run test"
}
},
"ava": {
"babel": {
"compileAsTests": [
"test/helpers/**/*"
]
},
"files": [
"test/swing/**/*"
],
"require": [
"@babel/register",
"./test/helpers/setupBrowserEnvironment.js"
]
}
}
2 changes: 2 additions & 0 deletions src/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ const Card = (stack, targetElement, prepend) => {
coordinateX: 0,
coordinateY: 0
};
lastX = 0;
lastY = 0;

/* Mapping directions to event names */
throwDirectionToEventName = {};
Expand Down
2 changes: 1 addition & 1 deletion test/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"canonical/mocha"
],
"rules": {
"mocha/no-setup-in-describe": 0
"id-length": 0
}
}
7 changes: 7 additions & 0 deletions test/helpers/setupBrowserEnvironment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import createBrowserEnv from 'browser-env';

createBrowserEnv([
'window',
'document',
'navigator'
]);
262 changes: 0 additions & 262 deletions test/swing.js

This file was deleted.

Loading

0 comments on commit 7911f66

Please sign in to comment.