forked from sourcegraph/sourcegraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.jest.js
30 lines (26 loc) · 837 Bytes
/
babel.config.jest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// @ts-check
// A minimal babel config only for jest transformations.
// All typescript and react transformations are done by previous
// bazel build rules, so we only need to do jest transformations here.
// TODO(bazel): drop when non-bazel removed.
if (!(process.env.JS_BINARY__TARGET || process.env.BAZEL_BINDIR || process.env.BAZEL_TEST)) {
throw new Error(__filename + ' is only for use with Bazel')
}
/** @type {import('@babel/core').ConfigFunction} */
module.exports = api => {
api.cache.forever()
return {
presets: [
[
'@babel/preset-env',
{
targets: {
// We only run jest tests in node. All the browser related transformations
// are already completed on the previous transpilation step.
node: '16',
},
},
],
],
}
}