Skip to content

Commit

Permalink
bun:test
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Jan 16, 2025
1 parent 961e6d0 commit 5d194bc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@tailwindcss/typography": "^0.5.13",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.7",
"@types/bun": "^1.1.16",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.0",
Expand Down
13 changes: 10 additions & 3 deletions src/app/App.test.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { Suspense } from 'react'
import { expect, test } from 'vitest'
import { render, screen } from '@testing-library/react'
import { afterEach, expect, test } from 'bun:test'
import { cleanup, render, screen } from '@testing-library/react'
import * as matchers from '@testing-library/jest-dom/matchers'

import App from '.'

expect.extend(matchers);

afterEach(() => {
cleanup()
})

test('renders without crashing', () => {
render(<Suspense fallback="loading"><App /></Suspense>)
expect(screen.getByText('flash.comma.ai')).toBeInTheDocument()
expect(screen.getByText('flash.comma.ai')).toBeTruthy()
})
6 changes: 3 additions & 3 deletions src/utils/manifest.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test, vi } from 'vitest'
import { describe, expect, test, vi } from 'bun:test'

import * as Comlink from 'comlink'

Expand Down Expand Up @@ -57,13 +57,13 @@ for (const [branch, manifestUrl] of Object.entries(config.manifests)) {
})),
}

globalThis.navigator = {
Object.assign(globalThis.navigator, {
storage: {
getDirectory: () => ({
getFileHandle: () => imageWorkerFileHandler,
})
}
}
})

imageWorkerFileHandler.getFile.mockImplementation(async () => {
const response = await fetch(image.archiveUrl)
Expand Down

0 comments on commit 5d194bc

Please sign in to comment.