Skip to content

Commit

Permalink
Merge pull request #842 from remap-keys/remove-jest-related-dependencies
Browse files Browse the repository at this point in the history
Remove dependencies related to Jest
  • Loading branch information
yoichiro authored Jun 5, 2024
2 parents b02ae32 + 1882591 commit 156c95f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 263 deletions.
9 changes: 6 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"env": {
"es6": true,
"node": true,
"jest": true,
"jasmine": true,
"browser": true
},
"parser": "@typescript-eslint/parser",
Expand Down Expand Up @@ -33,6 +31,11 @@
"react/prop-types": "warn"
},
"globals": {
"HIDDevice": "readonly"
"HIDDevice": "readonly",
"describe": "readonly",
"test": "readonly",
"expect": "readonly",
"fail": "readonly",
"assert": "readonly"
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"@storybook/node-logger": "^6.1.14",
"@storybook/preset-create-react-app": "^3.1.5",
"@storybook/react": "^6.1.14",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/ajv": "^1.0.0",
Expand Down
48 changes: 24 additions & 24 deletions src/services/macro/Macro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ describe('Macro', () => {
).toBeTruthy();
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
expect(actual.macroKeys[1].type).toEqual('tap');
if (isTap(actual.macroKeys[1])) {
Expand All @@ -352,7 +352,7 @@ describe('Macro', () => {
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAscii).toBeFalsy();
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[1] is not Tap');
assert.fail('actual.macroKeys[1] is not Tap');
}
expect(actual.macroKeys[2].type).toEqual('hold');
if (isHold(actual.macroKeys[2])) {
Expand All @@ -372,7 +372,7 @@ describe('Macro', () => {
actual.macroKeys[2].keyDelayPairs[0].key.keymap.isAny
).toBeFalsy();
} else {
fail('actual.macroKeys[2] is not Hold');
assert.fail('actual.macroKeys[2] is not Hold');
}
});

Expand Down Expand Up @@ -428,7 +428,7 @@ describe('Macro', () => {
).toBeTruthy();
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
expect(actual.macroKeys[1].type).toEqual('tap');
if (isTap(actual.macroKeys[1])) {
Expand All @@ -440,7 +440,7 @@ describe('Macro', () => {
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAny).toBeFalsy();
expect(actual.macroKeys[1].keyDelayPair.delay).toEqual(456);
} else {
fail('actual.macroKeys[1] is not Tap');
assert.fail('actual.macroKeys[1] is not Tap');
}
expect(actual.macroKeys[2].type).toEqual('hold');
if (isHold(actual.macroKeys[2])) {
Expand All @@ -461,7 +461,7 @@ describe('Macro', () => {
).toBeFalsy();
expect(actual.macroKeys[2].keyDelayPairs[0].delay).toEqual(789);
} else {
fail('actual.macroKeys[2] is not Hold');
assert.fail('actual.macroKeys[2] is not Hold');
}
});

Expand Down Expand Up @@ -489,7 +489,7 @@ describe('Macro', () => {
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAscii).toBeFalsy();
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
actual = subject.generateMacroKeys('ja-jp');
expect(actual.success).toBeTruthy();
Expand All @@ -503,7 +503,7 @@ describe('Macro', () => {
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAscii).toBeFalsy();
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
});

Expand Down Expand Up @@ -545,7 +545,7 @@ describe('Macro', () => {
).toBeTruthy();
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
expect(actual.macroKeys[1].type).toEqual('tap');
if (isTap(actual.macroKeys[1])) {
Expand All @@ -558,7 +558,7 @@ describe('Macro', () => {
).toBeTruthy();
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[1] is not Tap');
assert.fail('actual.macroKeys[1] is not Tap');
}
expect(actual.macroKeys[2].type).toEqual('tap');
if (isTap(actual.macroKeys[2])) {
Expand All @@ -571,7 +571,7 @@ describe('Macro', () => {
).toBeTruthy();
expect(actual.macroKeys[2].keyDelayPair.key.keymap.isAny).toBeTruthy();
} else {
fail('actual.macroKeys[2] is not Tap');
assert.fail('actual.macroKeys[2] is not Tap');
}
});

Expand Down Expand Up @@ -620,7 +620,7 @@ describe('Macro', () => {
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
expect(actual.macroKeys[0].keyDelayPair.delay).toEqual(123);
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
expect(actual.macroKeys[1].type).toEqual('tap');
if (isTap(actual.macroKeys[1])) {
Expand All @@ -634,7 +634,7 @@ describe('Macro', () => {
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAny).toBeFalsy();
expect(actual.macroKeys[1].keyDelayPair.delay).toEqual(456);
} else {
fail('actual.macroKeys[1] is not Tap');
assert.fail('actual.macroKeys[1] is not Tap');
}
expect(actual.macroKeys[2].type).toEqual('tap');
if (isTap(actual.macroKeys[2])) {
Expand All @@ -648,7 +648,7 @@ describe('Macro', () => {
expect(actual.macroKeys[2].keyDelayPair.key.keymap.isAny).toBeTruthy();
expect(actual.macroKeys[2].keyDelayPair.delay).toEqual(789);
} else {
fail('actual.macroKeys[2] is not Tap');
assert.fail('actual.macroKeys[2] is not Tap');
}
});

Expand Down Expand Up @@ -682,7 +682,7 @@ describe('Macro', () => {
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAscii).toBeFalsy();
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
expect(actual.macroKeys[1].type).toEqual('tap');
if (isTap(actual.macroKeys[1])) {
Expand All @@ -693,7 +693,7 @@ describe('Macro', () => {
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAscii).toBeFalsy();
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[1] is not Tap');
assert.fail('actual.macroKeys[1] is not Tap');
}
expect(actual.macroKeys[2].type).toEqual('tap');
if (isTap(actual.macroKeys[2])) {
Expand All @@ -704,7 +704,7 @@ describe('Macro', () => {
expect(actual.macroKeys[2].keyDelayPair.key.keymap.isAscii).toBeFalsy();
expect(actual.macroKeys[2].keyDelayPair.key.keymap.isAny).toBeFalsy();
} else {
fail('actual.macroKeys[2] is not Tap');
assert.fail('actual.macroKeys[2] is not Tap');
}
});

Expand Down Expand Up @@ -757,7 +757,7 @@ describe('Macro', () => {
expect(actual.macroKeys[0].keyDelayPair.key.keymap.isAny).toBeFalsy();
expect(actual.macroKeys[0].keyDelayPair.delay).toEqual(123);
} else {
fail('actual.macroKeys[0] is not Tap');
assert.fail('actual.macroKeys[0] is not Tap');
}
expect(actual.macroKeys[1].type).toEqual('tap');
if (isTap(actual.macroKeys[1])) {
Expand All @@ -769,7 +769,7 @@ describe('Macro', () => {
expect(actual.macroKeys[1].keyDelayPair.key.keymap.isAny).toBeFalsy();
expect(actual.macroKeys[1].keyDelayPair.delay).toEqual(456);
} else {
fail('actual.macroKeys[1] is not Tap');
assert.fail('actual.macroKeys[1] is not Tap');
}
expect(actual.macroKeys[2].type).toEqual('tap');
if (isTap(actual.macroKeys[2])) {
Expand All @@ -781,7 +781,7 @@ describe('Macro', () => {
expect(actual.macroKeys[2].keyDelayPair.key.keymap.isAny).toBeFalsy();
expect(actual.macroKeys[2].keyDelayPair.delay).toEqual(789);
} else {
fail('actual.macroKeys[2] is not Tap');
assert.fail('actual.macroKeys[2] is not Tap');
}
});

Expand Down Expand Up @@ -847,7 +847,7 @@ describe('Macro', () => {
actual.macroKeys[0].keyDelayPairs[1].key.keymap.isAny
).toBeFalsy();
} else {
fail('actual.macroKeys[0] is not Hold');
assert.fail('actual.macroKeys[0] is not Hold');
}
expect(actual.macroKeys[1].type).toEqual('hold');
if (isHold(actual.macroKeys[1])) {
Expand All @@ -867,7 +867,7 @@ describe('Macro', () => {
actual.macroKeys[1].keyDelayPairs[0].key.keymap.isAny
).toBeFalsy();
} else {
fail('actual.macroKeys[1] is not Hold');
assert.fail('actual.macroKeys[1] is not Hold');
}
});

Expand Down Expand Up @@ -953,7 +953,7 @@ describe('Macro', () => {
).toBeFalsy();
expect(actual.macroKeys[0].keyDelayPairs[1].delay).toEqual(456);
} else {
fail('actual.macroKeys[0] is not Hold');
assert.fail('actual.macroKeys[0] is not Hold');
}
expect(actual.macroKeys[1].type).toEqual('hold');
if (isHold(actual.macroKeys[1])) {
Expand All @@ -974,7 +974,7 @@ describe('Macro', () => {
).toBeFalsy();
expect(actual.macroKeys[1].keyDelayPairs[0].delay).toEqual(789);
} else {
fail('actual.macroKeys[1] is not Hold');
assert.fail('actual.macroKeys[1] is not Hold');
}
});

Expand Down
5 changes: 0 additions & 5 deletions src/setupTests.ts

This file was deleted.

4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/// <reference types="vitest" />
import react from '@vitejs/plugin-react-swc';
import { defineConfig, Plugin, loadEnv } from 'vite';
import { Plugin, loadEnv } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import { defineConfig } from 'vitest/config';

export default defineConfig(({ mode }) => {
return {
Expand All @@ -19,7 +20,6 @@ export default defineConfig(({ mode }) => {
test: {
globals: true,
environment: 'happy-dom',
setupFiles: 'setupTests.ts',
},
};
});
Expand Down
Loading

0 comments on commit 156c95f

Please sign in to comment.