sourcegraph/client/browser/vitest.config.ts
Quinn Slack 4002774429
reapply "switch from jest to vitest for faster, simpler tests (#57886)" (#58145)
* reapply "switch from jest to vitest for faster, simpler tests (https://github.com/sourcegraph/sourcegraph/pull/57886)"

This was reverted in https://github.com/sourcegraph/sourcegraph/pull/58116 due to an issue with the browser tests.

* include fetch-mock

* fix flakiness

* rm mock that did not work in experimentalVmThreads

* fix

* timeout

* fixup

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2023-11-07 12:00:18 +02:00

35 lines
1.2 KiB
TypeScript

import { BAZEL, defineProjectWithDefaults } from '../../vitest.shared'
export default defineProjectWithDefaults(__dirname, {
test: {
environment: 'jsdom',
environmentMatchGlobs: [
// TODO(sqs): can't use jsdom because it breaks simmerjs
// (https://github.com/jsdom/jsdom/issues/3612#issuecomment-1778560104)
['src/**/domFunctions.test.tsx', 'happy-dom'],
['src/shared/code-hosts/bitbucket-cloud/*', 'happy-dom'],
],
experimentalVmThreads: false,
setupFiles: ['src/testSetup.test.ts', '../testing/src/reactCleanup.ts', '../testing/src/fetch.js'],
},
plugins: BAZEL
? [
{
// The github/codeHost.tsx file imports sourcegraph-mark.svg, but this is not
// needed for any tests. Just ignore it.
name: 'no-sourcegrah-mark-svg',
resolveId(id) {
if (id.endsWith('/sourcegraph-mark.svg')) {
return { id, external: true }
}
return undefined
},
},
]
: undefined,
})