mirror of
https://github.com/penpot/penpot.git
synced 2025-02-11 01:28:30 -05:00
✨ Add initial vitest test file template
This commit is contained in:
parent
9c969f8b26
commit
127b02922f
4 changed files with 3499 additions and 55 deletions
|
@ -62,6 +62,7 @@
|
||||||
"gulp-sass": "^5.1.0",
|
"gulp-sass": "^5.1.0",
|
||||||
"gulp-sourcemaps": "^3.0.0",
|
"gulp-sourcemaps": "^3.0.0",
|
||||||
"gulp-svg-sprite": "^2.0.3",
|
"gulp-svg-sprite": "^2.0.3",
|
||||||
|
"jsdom": "^23.0.1",
|
||||||
"map-stream": "0.0.7",
|
"map-stream": "0.0.7",
|
||||||
"marked": "^7.0.5",
|
"marked": "^7.0.5",
|
||||||
"mkdirp": "^3.0.1",
|
"mkdirp": "^3.0.1",
|
||||||
|
@ -74,8 +75,10 @@
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"sass": "^1.69.5",
|
"sass": "^1.69.5",
|
||||||
"shadow-cljs": "2.26.2",
|
"shadow-cljs": "2.26.2",
|
||||||
|
"storybook": "^7.6.6",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vite": "^5.0.10"
|
"vite": "^5.0.10",
|
||||||
|
"vitest": "^1.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"date-fns": "^2.30.0",
|
"date-fns": "^2.30.0",
|
||||||
|
|
|
@ -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)
|
||||||
|
});
|
|
@ -1,8 +1,15 @@
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
|
import { configDefaults } from 'vitest/config'
|
||||||
|
|
||||||
import { resolve } from "path";
|
import { resolve } from "path";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
exclude: [...configDefaults.exclude, 'target/**', 'resources/**'],
|
||||||
|
environment: 'jsdom'
|
||||||
|
},
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@target": resolve(__dirname, "./target/storybook"),
|
"@target": resolve(__dirname, "./target/storybook"),
|
||||||
|
|
3532
frontend/yarn.lock
3532
frontend/yarn.lock
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue