Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test coverage #2

Merged
merged 16 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/src/routes/examples/plugins/collidable/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
});

// --- Draggable events --- //
droppable.on('collidable:in', ({ collidingElement }: CollidableInEvent) => {
droppable.on('collide:in', ({ collidingElement }: CollidableInEvent) => {
if (collidingElement.classList.contains(wallClass)) colliding = true;
else collidingWithWall = collidingElement.id;
});

droppable.on('collidable:out', ({ collidingElement }: CollidableOutEvent) => {
droppable.on('collide:out', ({ collidingElement }: CollidableOutEvent) => {
if (collidingElement.classList.contains(wallClass)) colliding = false;
else collidingWithWall = undefined;
});
Expand Down
4 changes: 2 additions & 2 deletions examples/src/sections/Collidable/Collidable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
canPlayOverSound = false;
});

draggable.on('collidable:in', ({ collidingElement }: CollidableInEvent) => {
draggable.on('collide:in', ({ collidingElement }: CollidableInEvent) => {
soundEffects.single.play('cubeCollide');
collidingElement.classList.add('colliding');
});

draggable.on('collidable:out', ({ collidingElement }: CollidableOutEvent) => {
draggable.on('collide:out', ({ collidingElement }: CollidableOutEvent) => {
collidingElement.classList.remove('colliding');
});
}
Expand Down
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
const config = {
verbose: true,
testEnvironment: 'jest-environment-jsdom',
setupFilesAfterEnv: [
'<rootDir>/src/test-utils/setup.ts',
'<rootDir>/src/test-utils/environment.ts',
],
setupFilesAfterEnv: ['<rootDir>/src/test-utils/setup.ts'],
fakeTimers: { enableGlobally: true },
modulePathIgnorePatterns: ['<rootDir>/lib/'],
moduleDirectories: ['node_modules', 'src'],
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"types": "./dist/index.d.ts",
"exports": "./dist/index.js",
"scripts": {
"build": "vite build",
"build": "tsc --noEmit && vite build",
"format": "prettier --write './src/**/*.{ts,tsx}'",
"typecheck": "tsc --noEmit",
"lint": "eslint './src/**.{ts,tsx}' --fix",
Expand All @@ -54,21 +54,21 @@
"@babel/preset-typescript": "^7.18.6",
"@testing-library/dom": "^8.17.1",
"@testing-library/jest-dom": "^5.16.5",
"@types/jest": "^28.1.6",
"@types/jest": "^28.1.7",
"@types/testing-library__jest-dom": "^5.14.5",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"codecov": "^3.8.2",
"core-js": "^3.24.1",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"prettier": "^2.7.1",
"typescript": "^4.7.4",
"vite": "^2.9.15",
"vite": "^3.0.8",
"vite-plugin-dts": "^1.4.1",
"vite-plugin-env-compatible": "^1.1.1",
"vite-plugin-html": "^3.2.0",
Expand Down
Loading