Skip to content

Commit

Permalink
test: use Vitest Browser Mode with Puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Nov 28, 2024
1 parent 13df48f commit 7c42523
Show file tree
Hide file tree
Showing 18 changed files with 1,136 additions and 1,881 deletions.
1,108 changes: 366 additions & 742 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,30 +61,31 @@
"@types/react-test-renderer": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"@vitejs/plugin-react": "^4.3.3",
"@vitest/coverage-v8": "^2.1.5",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/browser": "^2.1.6",
"@vitest/coverage-v8": "^2.1.6",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-tsdoc": "^0.3.0",
"eslint-plugin-tsdoc": "^0.4.0",
"happy-dom": "^15.11.6",
"msw": "^2.6.5",
"node-fetch": "^3.3.2",
"prettier": "^3.3.3",
"playwright": "^1.49.0",
"prettier": "^3.4.1",
"prettier-plugin-jsdoc": "^1.3.0",
"react": "^18.2.0",
"react-dom": "^18.3.1",
"react-test-renderer": "^18.3.1",
"rollup-plugin-preserve-directives": "^0.4.0",
"rollup-preserve-directives": "^1.1.2",
"rollup-preserve-directives": "^1.1.3",
"size-limit": "^11.1.6",
"standard-version": "^9.5.0",
"typescript": "^5.6.3",
"vite": "^5.4.11",
"vite-plugin-sdk": "^0.1.2",
"vitest": "^2.1.5"
"typescript": "^5.7.2",
"vite": "^6.0.0",
"vitest": "^2.1.6",
"vitest-browser-react": "^0.0.4"
},
"peerDependencies": {
"@prismicio/client": "^7",
Expand Down
7 changes: 5 additions & 2 deletions src/PrismicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,11 @@ export const PrismicLink = forwardRef(function PrismicLink<
defaultComponent) as ComponentType<LinkProps>;
const ExternalComponent = (externalComponent ||
defaultComponent) as ComponentType<LinkProps>;
const Component =
href && isInternalURL(href) ? InternalComponent : ExternalComponent;
const Component = href
? isInternalURL(href)
? InternalComponent
: ExternalComponent
: InternalComponent;

return (
<Component ref={ref} {...attrs} {...restProps} href={href} rel={rel}>
Expand Down
Loading

0 comments on commit 7c42523

Please sign in to comment.