Skip to content

Commit

Permalink
test: migrate to vitest (#380)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeroen Claassens <support@favware.tech>
  • Loading branch information
imranbarbhuiya and favna committed Jun 20, 2022
1 parent dd7beea commit 075ec73
Show file tree
Hide file tree
Showing 89 changed files with 968 additions and 2,457 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Build test dependencies
run: yarn turbo run build --filter=@sapphire/async-queue --filter=@sapphire/*utilities --filter=@sapphire/ratelimits --filter=@sapphire/fetch --no-deps
- name: Run tests
run: yarn test:coverage
run: yarn test
- name: Store code coverage report
if: ${{ matrix.node == '18' }}
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
Expand Down
23 changes: 0 additions & 23 deletions jest.config.mjs

This file was deleted.

13 changes: 5 additions & 8 deletions package.json
Expand Up @@ -9,8 +9,7 @@
"clean:full": "node scripts/clean-full.mjs",
"lint": "eslint packages --ext mjs,js,ts,tsx --fix",
"format": "prettier --write \"packages/**/{src,tests,scripts}/**/*.{mjs,ts,js}\"",
"test": "turbo run test",
"test:coverage": "yarn jest --coverage",
"test": "vitest run",
"build": "turbo run build",
"docs": "typedoc",
"update": "yarn upgrade-interactive",
Expand All @@ -25,35 +24,33 @@
"@favware/npm-deprecate": "^1.0.4",
"@favware/rollup-type-bundler": "^1.0.7",
"@sapphire/framework": "^2.5.1",
"@types/jest": "^28.1.2",
"@types/lodash": "^4.14.182",
"@types/node": "^17.0.42",
"@types/node": "^18.0.0",
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"c8": "^7.11.3",
"cz-conventional-changelog": "^3.3.0",
"discord-api-types": "^0.33.5",
"discord.js": "^13.8.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.1",
"jest": "^28.1.1",
"jest-extended": "^2.0.0",
"lint-staged": "^13.0.2",
"lodash": "^4.17.21",
"nock": "^13.2.7",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.5",
"tslib": "^2.4.0",
"tsup": "^6.1.2",
"turbo": "^1.2.16",
"typedoc": "^0.22.17",
"typedoc-plugin-djs-links": "^1.0.4",
"typedoc-plugin-mdn-links": "^1.0.6",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"vitest": "^0.15.1"
},
"repository": {
"type": "git",
Expand Down
13 changes: 0 additions & 13 deletions packages/async-queue/jest.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/async-queue/package.json
Expand Up @@ -17,7 +17,7 @@
"sideEffects": false,
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/async-queue",
"scripts": {
"test": "jest",
"test": "vitest run",
"lint": "eslint src tests --ext ts --fix -c ../../.eslintrc",
"build": "tsup && tsc -b src",
"prepack": "yarn build",
Expand Down
3 changes: 2 additions & 1 deletion packages/async-queue/tests/tsconfig.json
Expand Up @@ -4,7 +4,8 @@
"target": "ES2020",
"rootDir": "./",
"outDir": "./build",
"tsBuildInfoFile": "./build/.tsbuildinfo"
"tsBuildInfoFile": "./build/.tsbuildinfo",
"types": ["vitest/globals"]
},
"include": ["./"],
"references": [{ "path": "../src" }]
Expand Down
7 changes: 7 additions & 0 deletions packages/async-queue/vitest.config.ts
@@ -0,0 +1,7 @@
import { createVitestConfig } from '../../scripts/vitest.config';

export default createVitestConfig({
esbuild: {
target: 'es2020'
}
});
13 changes: 0 additions & 13 deletions packages/decorators/jest.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/decorators/package.json
Expand Up @@ -14,7 +14,7 @@
"sideEffects": false,
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/decorators",
"scripts": {
"test": "jest",
"test": "vitest run",
"lint": "eslint src tests --ext ts --fix -c ../../.eslintrc",
"build": "tsup && tsc -b src",
"prepack": "yarn build",
Expand Down
3 changes: 2 additions & 1 deletion packages/decorators/tests/tsconfig.json
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"rootDir": ".",
"outDir": "../test-dist",
"tsBuildInfoFile": "../test-dist/.tsbuildinfo"
"tsBuildInfoFile": "../test-dist/.tsbuildinfo",
"types": ["vitest/globals"]
},
"include": [".", "../src/**/*"],
"references": [{ "path": "../src" }]
Expand Down
3 changes: 3 additions & 0 deletions packages/decorators/vitest.config.ts
@@ -0,0 +1,3 @@
import { createVitestConfig } from '../../scripts/vitest.config';

export default createVitestConfig();
15 changes: 0 additions & 15 deletions packages/discord-utilities/jest.config.mjs

This file was deleted.

15 changes: 0 additions & 15 deletions packages/discord.js-utilities/jest.config.mjs

This file was deleted.

14 changes: 0 additions & 14 deletions packages/eslint-config/jest.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Expand Up @@ -13,7 +13,7 @@
"sideEffects": false,
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/eslint-config",
"scripts": {
"test": "jest",
"test": "vitest run",
"prelint": "yarn test && yarn build",
"build": "tsup",
"prepack": "yarn build",
Expand Down

0 comments on commit 075ec73

Please sign in to comment.