Skip to content

Commit

Permalink
test: use happy-dom env
Browse files Browse the repository at this point in the history
  • Loading branch information
Niznikr committed Jul 20, 2022
1 parent 0b17691 commit f244ce6
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"expect-axe-playwright": "^2.2.1",
"fast-glob": "^3.2.11",
"framer-motion": "^6.5.1",
"happy-dom": "^6.0.4",
"husky": "^8.0.1",
"jsdom": "^20.0.0",
"lint-staged": "^13.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/menu/__tests__/Menu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { it, expect, describe, vi } from 'vitest';
import { render, screen, userEvent, waitFor } from '../../../test/utils';
import { Menu, MenuDivider, MenuItem, MenuItemLink, MenuSearch } from '../src';

// @vitest-environment jsdom

type TestMenu = {
hideSearch?: boolean;
};
Expand Down
2 changes: 2 additions & 0 deletions packages/tab-list/__tests__/TabList.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Item } from '@react-stately/collections';
import { render, screen, userEvent } from '../../../test/utils';
import { TabList } from '../src';

// @vitest-environment jsdom

describe('TabList', () => {
it('renders', async () => {
render(
Expand Down
2 changes: 2 additions & 0 deletions packages/toggle/__tests__/Toggle.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { render, screen, userEvent, waitFor } from '../../../test/utils';
import { Toggle } from '../src';

// @vitest-environment jsdom

describe('Toggle', () => {
it('renders a Toggle', async () => {
const toggleProps = {
Expand Down
121 changes: 119 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default defineConfig({
},
test: {
globals: true,
environment: 'jsdom',
environment: 'happy-dom',
setupFiles: [path.resolve(__dirname, './test/setup.ts')],
include: ['**/__tests__/*.spec.{ts,tsx}'],
coverage: {
Expand Down

0 comments on commit f244ce6

Please sign in to comment.