Skip to content

🎥 Make videos programmatically with React

migrate eslint-plugin to vitest

Jonny Burger8057fa3fb722
diff --git a/packages/eslint-plugin/jest.config.js b/packages/eslint-plugin/jest.config.js
deleted file mode 100644
index 0dff416c78..0000000000
--- a/packages/eslint-plugin/jest.config.js
+++ /dev/null
@@ -1,6 +0,0 @@
-module.exports = {
- preset: "ts-jest",
- testEnvironment: "node",
- testRegex: "./tests/.+\\.test\\.ts$",
- moduleFileExtensions: ["ts", "tsx", "js"],
-};
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index bc682007e9..17b698c9e4 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -4,7 +4,7 @@
"description": "A set of rules helping you avoid common pitfalls in Remotion.",
"scripts": {
"build": "tsc -d",
- "test": "jest",
+ "test": "vitest --run",
"watch": "tsc -w"
},
"main": "dist/index.js",
@@ -18,9 +18,8 @@
},
"devDependencies": {
"eslint": "8.13.0",
- "jest": "^27.2.4",
- "ts-jest": "^27.0.5",
- "typescript": "^4.7.0"
+ "typescript": "^4.7.0",
+ "vitest": "0.24.3"
},
"private": false
}
diff --git a/packages/eslint-plugin/src/tests/setup.ts b/packages/eslint-plugin/src/tests/setup.ts
new file mode 100644
index 0000000000..3d06ee5fb9
--- /dev/null
+++ b/packages/eslint-plugin/src/tests/setup.ts
@@ -0,0 +1,6 @@
+import { describe, it } from "vitest";
+
+// @ts-expect-error
+global.describe = describe;
+// @ts-expect-error
+global.it = it;
diff --git a/packages/eslint-plugin/vitest.config.ts b/packages/eslint-plugin/vitest.config.ts
new file mode 100644
index 0000000000..10c4bfdcc3
--- /dev/null
+++ b/packages/eslint-plugin/vitest.config.ts
@@ -0,0 +1,10 @@
+import { defineConfig } from "vitest/config";
+
+export default defineConfig({
+ test: {
+ testTimeout: 90000,
+ maxConcurrency: 1,
+ threads: false,
+ setupFiles: ["src/tests/setup.ts"],
+ },
+});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index eacd9cc980..c31368bfcd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -370,16 +370,14 @@ importers:
specifiers:
'@typescript-eslint/utils': 5.19.0
eslint: 8.13.0
- jest: ^27.2.4
- ts-jest: ^27.0.5
typescript: ^4.7.0
+ vitest: 0.24.3
dependencies:
'@typescript-eslint/utils': 5.19.0_6hvhxfirl4y3p6nuemvvvbadcu
devDependencies:
eslint: 8.13.0
- jest: 27.2.4
- ts-jest: 27.0.5_rvlwc6ridvtrh4l2o34pdixd4e
typescript: 4.7.2
+ vitest: 0.24.3
packages/example:
specifiers:
@@ -15157,7 +15155,7 @@ packages:
optional: true
dependencies:
abab: 2.0.5
- acorn: 8.7.0
+ acorn: 8.8.0
acorn-globals: 6.0.0
cssom: 0.4.4
cssstyle: 2.3.0
@@ -20836,37 +20834,6 @@ packages:
yargs-parser: 20.2.9
dev: true
- /ts-jest/27.0.5_rvlwc6ridvtrh4l2o34pdixd4e:
- resolution: {integrity: sha512-lIJApzfTaSSbtlksfFNHkWOzLJuuSm4faFAfo5kvzOiRAuoN4/eKxVJ2zEAho8aecE04qX6K1pAzfH5QHL1/8w==}
- engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
- hasBin: true
- peerDependencies:
- '@babel/core': '>=7.0.0-beta.0 <8'
- '@types/jest': ^27.0.0
- babel-jest: '>=27.0.0 <28'
- jest: ^27.0.0
- typescript: '>=3.8 <5.0'
- peerDependenciesMeta:
- '@babel/core':
- optional: true
- '@types/jest':
- optional: true
- babel-jest:
- optional: true
- dependencies:
- '@babel/core': 7.18.6
- bs-logger: 0.2.6
- fast-json-stable-stringify: 2.1.0
- jest: 27.2.4
- jest-util: 27.5.1
- json5: 2.2.1
- lodash: 4.17.21
- make-error: 1.3.6
- semver: 7.3.7
- typescript: 4.7.2
- yargs-parser: 20.2.9
- dev: true
-
/ts-node/10.8.0_ysvagj6uoj2jcpx4fli7niyicq:
resolution: {integrity: sha512-/fNd5Qh+zTt8Vt1KbYZjRHCE9sI5i7nqfD/dzBBRDeVXZXS6kToW6R7tTU6Nd4XavFs0mAVCg29Q//ML7WsZYA==}
hasBin: true