mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-28 07:43:18 +00:00
🧪 Add Vitest testing framework with basic composition test
Set up testing infrastructure using Vitest and React Testing Library. Add test verifying empty MyComposition renders without errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2644
videos/package-lock.json
generated
2644
videos/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -20,18 +20,25 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@remotion/eslint-config-flat": "4.0.409",
|
"@remotion/eslint-config-flat": "4.0.409",
|
||||||
|
"@testing-library/jest-dom": "^6.9.1",
|
||||||
|
"@testing-library/react": "^16.3.2",
|
||||||
"@types/react": "19.2.7",
|
"@types/react": "19.2.7",
|
||||||
"@types/three": "^0.182.0",
|
"@types/three": "^0.182.0",
|
||||||
"@types/web": "0.0.166",
|
"@types/web": "0.0.166",
|
||||||
|
"@vitejs/plugin-react": "^5.1.2",
|
||||||
"eslint": "9.19.0",
|
"eslint": "9.19.0",
|
||||||
|
"jsdom": "^27.4.0",
|
||||||
"prettier": "3.6.0",
|
"prettier": "3.6.0",
|
||||||
"typescript": "5.9.3"
|
"typescript": "5.9.3",
|
||||||
|
"vitest": "^4.0.18"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "remotion studio",
|
"dev": "remotion studio",
|
||||||
"build": "remotion bundle",
|
"build": "remotion bundle",
|
||||||
"upgrade": "remotion upgrade",
|
"upgrade": "remotion upgrade",
|
||||||
"lint": "eslint src && tsc"
|
"lint": "eslint src && tsc",
|
||||||
|
"test": "vitest run",
|
||||||
|
"test:watch": "vitest"
|
||||||
},
|
},
|
||||||
"sideEffects": [
|
"sideEffects": [
|
||||||
"*.css"
|
"*.css"
|
||||||
|
|||||||
15
videos/src/Composition.test.tsx
Normal file
15
videos/src/Composition.test.tsx
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { describe, it, expect } from "vitest";
|
||||||
|
import { render } from "@testing-library/react";
|
||||||
|
import { MyComposition } from "./Composition";
|
||||||
|
|
||||||
|
describe("MyComposition", () => {
|
||||||
|
it("renders without errors", () => {
|
||||||
|
const { container } = render(<MyComposition />);
|
||||||
|
expect(container).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("returns null (empty composition)", () => {
|
||||||
|
const { container } = render(<MyComposition />);
|
||||||
|
expect(container.firstChild).toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
1
videos/src/test/setup.ts
Normal file
1
videos/src/test/setup.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
import "@testing-library/jest-dom/vitest";
|
||||||
@@ -11,5 +11,5 @@
|
|||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"noUnusedLocals": true
|
"noUnusedLocals": true
|
||||||
},
|
},
|
||||||
"exclude": ["remotion.config.ts"]
|
"exclude": ["remotion.config.ts", "vitest.config.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
11
videos/vitest.config.ts
Normal file
11
videos/vitest.config.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { defineConfig } from "vitest/config";
|
||||||
|
import react from "@vitejs/plugin-react";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
test: {
|
||||||
|
environment: "jsdom",
|
||||||
|
setupFiles: ["./src/test/setup.ts"],
|
||||||
|
include: ["src/**/*.test.{ts,tsx}"],
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user