sourcegraph/.mocharc.js
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

20 lines
778 B
JavaScript

const IS_BAZEL = !!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)
const rootDir = IS_BAZEL ? process.cwd() : __dirname
module.exports = {
require: [
...(IS_BAZEL ? [] : ['ts-node/register/transpile-only']),
'abort-controller/polyfill',
rootDir + '/client/testing/src/fetch',
rootDir + '/client/shared/dev/suppressPollyErrors',
],
reporter: rootDir + '/client/shared/dev/customMochaSpecReporter.js',
extension: IS_BAZEL ? ['js'] : ['js', 'ts'],
// 1 minute test timeout. This must be greater than the default Puppeteer
// command timeout of 30s in order to get the stack trace to point to the
// Puppeteer command that failed instead of a cryptic test timeout
// location.
timeout: '60s',
slow: '2s',
}