Skip to content

Commit

Permalink
include only src in coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsinulhaq committed Nov 19, 2023
1 parent b82c8b2 commit 6f5fdb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"prepare": "husky install",
"prettier": "prettier --write src/**/*.{ts,tsx}",
"lint": "eslint \"{src,tests,examples}**/*.{ts,tsx}\"",
"test": "vitest --globals --environment happy-dom -w false --coverage",
"test": "vitest --globals --dom -w false --coverage",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
Expand Down
6 changes: 0 additions & 6 deletions tests/usePopperTooltip.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,18 @@ describe('trigger option', () => {

// Nothing after hover
user.hover(screen.getByText(TriggerText));
vi.runAllTimers();
expect(screen.queryByText(TooltipText)).not.toBeInTheDocument();

// Nothing after click
user.click(screen.getByText(TriggerText));
vi.runAllTimers();
expect(screen.queryByText(TooltipText)).not.toBeInTheDocument();

// Nothing after right-click
fireEvent.contextMenu(screen.getByText(TriggerText));
vi.runAllTimers();
expect(screen.queryByText(TooltipText)).not.toBeInTheDocument();

// Nothing after focus
fireEvent.focus(screen.getByText(TriggerText));
vi.runAllTimers();
expect(screen.queryByText(TooltipText)).not.toBeInTheDocument();
});
});
Expand Down Expand Up @@ -262,7 +258,6 @@ describe('visible option controls the state and', () => {

// The state is controlled, click doesn't change it
user.click(screen.getByText(TriggerText));
vi.runAllTimers();
expect(screen.queryByText(TooltipText)).not.toBeInTheDocument();
});

Expand All @@ -272,7 +267,6 @@ describe('visible option controls the state and', () => {

// The state is controlled, click doesn't change it
user.click(screen.getByText(TriggerText));
vi.runAllTimers();
expect(await screen.findByText(TooltipText)).toBeInTheDocument();
});
});
9 changes: 9 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {defineConfig} from 'vitest/config';

export default defineConfig({
test: {
coverage: {
include: ['src/**/*.ts'],
},
},
});

0 comments on commit 6f5fdb8

Please sign in to comment.