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

chore: Migrate from jest to vitest #51

Merged
merged 2 commits into from
Nov 27, 2024
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
13 changes: 0 additions & 13 deletions jest.config.js

This file was deleted.

13,284 changes: 3,752 additions & 9,532 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,27 @@
"build": "node postcss.js && tsc",
"postbuild": "cp dark-mode-utils.css package.json THIRD-PARTY-LICENSES.txt LICENSE README.md lib",
"lint": "eslint .",
"test": "jest --coverage"
"test": "vitest --run"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.1",
"@types/jest": "^27.4.0",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@vitest/coverage-istanbul": "^2.1.6",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-header": "3.1.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-unicorn": "^34.0.1",
"husky": "^9.0.11",
"jest": "^27.4.7",
"lint-staged": "^13.2.1",
"normalize.css": "^8.0.1",
"postcss": "^8.4.31",
"postcss-import": "^14.0.2",
"postcss-url": "^10.1.3",
"prettier": "^2.5.1",
"ts-jest": "^27.1.3",
"typescript": "^4.5.5"
"typescript": "^4.5.5",
"vitest": "^2.1.6"
},
"lint-staged": {
"*.{ts,js}": [
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/apply-mode.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { test, expect, beforeEach, afterEach } from 'vitest';
import { applyMode, Mode, applyDensity, Density } from '../index';

let originalClassName: string;
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/disable-motion.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { test, expect, beforeEach, afterEach } from 'vitest';
import { disableMotion } from '../index';

let originalClassName: string;
Expand Down
5 changes: 4 additions & 1 deletion src/__tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import '@testing-library/jest-dom/extend-expect';
import { expect } from 'vitest';
import * as matchers from '@testing-library/jest-dom/matchers';

expect.extend(matchers);
10 changes: 0 additions & 10 deletions src/__tests__/tsconfig.json

This file was deleted.

16 changes: 16 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
coverage: {
enabled: process.env.CI === 'true',
provider: 'istanbul',
include: ['src/**'],
exclude: ['**/debug-tools/**', '**/test/**'],
},
},
});
Loading