Skip to content

Commit

Permalink
fix test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed Jul 27, 2024
1 parent ddb3faa commit 99753d2
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 3 deletions.
69 changes: 69 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"preview": "astro preview",
"typecheck:astro": "astro check",
"typecheck:tsc": "tsc --noEmit --pretty",
"typecheck": "run-p --silent typecheck:astro typecheck:tsc",
"typecheck": "npm run typecheck:astro && npm run typecheck:tsc",
"prebuild": "run-p --silent --continue-on-error create:symlinks create:icons move:downloads",
"test:unit": "vitest run --config './test/vitest.config.ts' --coverage",
"test:unit:watch": "vitest watch --config './test/vitest.config.ts' --coverage",
Expand Down Expand Up @@ -74,6 +74,7 @@
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitest/coverage-v8": "^2.0.4",
"@vitest/ui": "^2.0.4",
"globby": "^14.0.2",
"hast-util-to-html": "^9.0.1",
"husky": "^9.1.3",
Expand Down
5 changes: 3 additions & 2 deletions src/features/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function Search(): ReactElement {
// Handle search and set results
const fuse = allPosts ? new Fuse(allPosts, fuseOptions) : null

// biome-ignore lint/correctness/useExhaustiveDependencies: fuse not needed
useEffect(() => {
if (!query || query === '' || !fuse) {
setResults([])
Expand All @@ -49,7 +50,7 @@ export default function Search(): ReactElement {
.slice(0, 6)

setResults(results)
}, [query, fuse])
}, [query])

// animate closing of search
async function toggleSearch(): Promise<void> {
Expand All @@ -73,6 +74,7 @@ export default function Search(): ReactElement {
onClick={toggleSearch}
title="Close search"
>
{/* biome-ignore lint/a11y/noSvgWithoutTitle: the button has title already */}
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
Expand All @@ -84,7 +86,6 @@ export default function Search(): ReactElement {
strokeLinecap="round"
strokeLinejoin="round"
>
<title>Close search</title>
<path d="M18 6 6 18M6 6l12 12" />
</svg>
</button>
Expand Down

0 comments on commit 99753d2

Please sign in to comment.