Debian Codegraph @

packages/babel-preset-env/test/regressions.js

raw symbols SCIP
1 import * as babel7_12 from "@babel/core";
2 import env from "../lib/index.js";
3 import path from "path";
4 import { fileURLToPath } from "url";
5
6 describe("#12880", () => {
7 it("read the .browserslistrc file when using @babel/core < 7.13.0", () => {
8 const root = path.join(
9 path.dirname(fileURLToPath(import.meta.url)),
10 "regressions",
11 );
12
13 // The browserslistrc file contains "firefox 50".
14 // a ** b is supported starting from firefox 52;
15 // a => b is supported starting from firefox 45.
16 const out = babel7_12.transformSync("a ** b; a => b;", {
17 configFile: false,
18 presets: [[env, { modules: false }]],
19 filename: path.join(root, "input.js"),
20 root,
21 });
22
23 expect(out.code).toMatchInlineSnapshot(`
24 "Math.pow(a, b);
25 a => b;"
26 `);
27 });
28 });