0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-05 22:09:06 -05:00

Add initial vitest test file template

This commit is contained in:
Andrey Antukh 2023-12-21 13:01:51 +01:00 committed by Alonso Torres
parent 9c969f8b26
commit 127b02922f
4 changed files with 3499 additions and 55 deletions

View file

@ -62,6 +62,7 @@
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-svg-sprite": "^2.0.3",
"jsdom": "^23.0.1",
"map-stream": "0.0.7",
"marked": "^7.0.5",
"mkdirp": "^3.0.1",
@ -74,8 +75,10 @@
"rimraf": "^5.0.5",
"sass": "^1.69.5",
"shadow-cljs": "2.26.2",
"storybook": "^7.6.6",
"typescript": "^5.3.3",
"vite": "^5.0.10"
"vite": "^5.0.10",
"vitest": "^1.1.0"
},
"dependencies": {
"date-fns": "^2.30.0",

View file

@ -0,0 +1,10 @@
import { expect, test } from 'vitest'
test('use jsdom in this test file', () => {
const element = document.createElement('div')
expect(element).not.toBeNull()
})
test('adds 1 + 2 to equal 3', () => {
expect(1 +2).toBe(3)
});

View file

@ -1,8 +1,15 @@
import { defineConfig } from "vite";
import { configDefaults } from 'vitest/config'
import { resolve } from "path";
// https://vitejs.dev/config/
export default defineConfig({
test: {
exclude: [...configDefaults.exclude, 'target/**', 'resources/**'],
environment: 'jsdom'
},
resolve: {
alias: {
"@target": resolve(__dirname, "./target/storybook"),

File diff suppressed because it is too large Load diff