Set up the Jest test environment

This commit is contained in:
Savanni D'Gerinel 2022-11-17 11:51:40 -05:00
parent 6210b433c7
commit a3345b0a4f
4 changed files with 1066 additions and 51 deletions

5
v-client/jest.config.cjs Normal file
View File

@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,8 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
"preview": "vite preview" "preview": "vite preview",
"test": "jest"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "^1.2.0", "@tauri-apps/api": "^1.2.0",
@ -25,6 +26,7 @@
"eslint": "^8.27.0", "eslint": "^8.27.0",
"eslint-config-react-app": "^7.0.1", "eslint-config-react-app": "^7.0.1",
"jest": "^29.3.1", "jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"sass": "^1.56.1", "sass": "^1.56.1",
"ts-jest": "^29.0.3", "ts-jest": "^29.0.3",

View File

@ -1,3 +1,7 @@
/**
* @jest-environment jsdom
*/
import React from "react"; import React from "react";
import { render, screen } from "@testing-library/react"; import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom"; import "@testing-library/jest-dom";