Skip to content

Commit

Permalink
tests: fix failing tests by introducing setup file
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Feb 21, 2023
1 parent f2e41d3 commit a56851a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/anu-vue/test/setup.vitest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { afterAll, beforeAll } from 'vitest'
import { createApp } from 'vue'
import { plugin } from '../src/plugin'

beforeAll(() => {
const app = createApp({})
app.use(plugin)
global.app = app
})

afterAll(() => {
delete global.app
})
1 change: 1 addition & 0 deletions packages/anu-vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./test/setup.vitest.ts'],
transformMode: {
web: [/.[tj]sx$/],
},
Expand Down

0 comments on commit a56851a

Please sign in to comment.