Use "validateLogs" for preset-env's debug fixtures (#10401)

* Add ability to ignore output to the test runner

* Use normal fixtures instead of custom debug-fixtures in preset-env
This commit is contained in:
Nicolò Ribaudo 2019-09-06 17:32:20 +02:00 committed by GitHub
parent 8769903284
commit 3e8a5c5e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
269 changed files with 1354 additions and 555 deletions

View File

@ -149,6 +149,7 @@ export default function get(entryLoc): Array<Suite> {
disabled: taskName[0] === ".", disabled: taskName[0] === ".",
options: taskOpts, options: taskOpts,
validateLogs: taskOpts.validateLogs, validateLogs: taskOpts.validateLogs,
ignoreOutput: taskOpts.ignoreOutput,
stdout: { loc: stdoutLoc, code: readFile(stdoutLoc) }, stdout: { loc: stdoutLoc, code: readFile(stdoutLoc) },
stderr: { loc: stderrLoc, code: readFile(stderrLoc) }, stderr: { loc: stderrLoc, code: readFile(stderrLoc) },
exec: { exec: {
@ -234,9 +235,23 @@ export default function get(entryLoc): Array<Suite> {
(test.stdout.code ? stdoutLoc : stderrLoc), (test.stdout.code ? stdoutLoc : stderrLoc),
); );
} }
if (test.options.ignoreOutput) {
if (test.expect.code) {
throw new Error(
"Test cannot ignore its output and also validate it: " + expectLoc,
);
}
if (!test.validateLogs) {
throw new Error(
"ignoreOutput can only be used when validateLogs is true: " +
taskOptsLoc,
);
}
}
// Delete to avoid option validation error // Delete to avoid option validation error
delete test.options.validateLogs; delete test.options.validateLogs;
delete test.options.ignoreOutput;
} }
} }

View File

@ -138,6 +138,7 @@ function run(task) {
options: opts, options: opts,
optionsDir, optionsDir,
validateLogs, validateLogs,
ignoreOutput,
stdout, stdout,
stderr, stderr,
} = task; } = task;
@ -221,33 +222,35 @@ function run(task) {
const outputCode = normalizeOutput(result.code); const outputCode = normalizeOutput(result.code);
checkDuplicatedNodes(babel, result.ast); checkDuplicatedNodes(babel, result.ast);
if ( if (!ignoreOutput) {
!expected.code && if (
outputCode && !expected.code &&
!opts.throws && outputCode &&
fs.statSync(path.dirname(expected.loc)).isDirectory() && !opts.throws &&
!process.env.CI fs.statSync(path.dirname(expected.loc)).isDirectory() &&
) { !process.env.CI
const expectedFile = expected.loc.replace( ) {
/\.m?js$/, const expectedFile = expected.loc.replace(
result.sourceType === "module" ? ".mjs" : ".js", /\.m?js$/,
); result.sourceType === "module" ? ".mjs" : ".js",
console.log(`New test file created: ${expectedFile}`);
fs.writeFileSync(expectedFile, `${outputCode}\n`);
if (expected.loc !== expectedFile) {
try {
fs.unlinkSync(expected.loc);
} catch (e) {}
}
} else {
validateFile(outputCode, expected.loc, expectedCode);
if (inputCode) {
expect(expected.loc).toMatch(
result.sourceType === "module" ? /\.mjs$/ : /\.js$/,
); );
console.log(`New test file created: ${expectedFile}`);
fs.writeFileSync(expectedFile, `${outputCode}\n`);
if (expected.loc !== expectedFile) {
try {
fs.unlinkSync(expected.loc);
} catch (e) {}
}
} else {
validateFile(outputCode, expected.loc, expectedCode);
if (inputCode) {
expect(expected.loc).toMatch(
result.sourceType === "module" ? /\.mjs$/ : /\.js$/,
);
}
} }
} }
@ -294,7 +297,10 @@ function validateFile(actualCode, expectedLoc, expectedCode) {
function normalizeOutput(code) { function normalizeOutput(code) {
return code return code
.trim() .trim()
.replace(escapeRegExp(path.resolve(__dirname, "../../../")), "<CWD>"); .replace(
new RegExp(escapeRegExp(path.resolve(__dirname, "../../../")), "g"),
"<CWD>",
);
} }
const toEqualFile = () => ({ const toEqualFile = () => ({

View File

@ -1,148 +0,0 @@
const child = require("child_process");
const fs = require("fs-extra");
const helper = require("@babel/helper-fixtures");
const path = require("path");
const fixtureLoc = path.join(__dirname, "debug-fixtures");
const tmpLoc = path.join(__dirname, "tmp");
const clear = () => {
process.chdir(__dirname);
if (fs.existsSync(tmpLoc)) fs.removeSync(tmpLoc);
fs.mkdirSync(tmpLoc);
process.chdir(tmpLoc);
};
const saveInFiles = files => {
Object.keys(files).forEach(filename => {
const content = files[filename];
fs.outputFileSync(filename, content);
});
};
const testOutputType = (type, stdTarg, opts) => {
stdTarg = stdTarg.trim();
stdTarg = stdTarg.replace(/\\/g, "/");
const optsTarg = opts[type];
if (optsTarg) {
const expectStdout = optsTarg.trim();
expect(stdTarg).toBe(expectStdout);
} else {
const file = path.join(opts.testLoc, `${type}.txt`);
console.log(`New test file created: ${file}`);
fs.outputFileSync(file, stdTarg);
}
};
const assertTest = (stdout, stderr, opts) => {
testOutputType("stdout", stdout, opts);
if (stderr) {
testOutputType("stderr", stderr, opts);
}
};
const buildTest = opts => {
const binLoc = require.resolve("@babel/cli/bin/babel");
return callback => {
clear();
saveInFiles(opts.inFiles);
let args = [binLoc];
args = args.concat(opts.args);
const spawn = child.spawn(process.execPath, args, {
cwd: tmpLoc,
});
let stdout = "";
let stderr = "";
spawn.stdout.on("data", chunk => (stdout += chunk));
spawn.stderr.on("data", chunk => (stderr += chunk));
spawn.on("close", () => {
let err;
try {
stdout = replacePaths(stdout);
stderr = replacePaths(stderr);
assertTest(stdout, stderr, opts);
} catch (e) {
err = e;
}
callback(err);
});
};
};
function replacePaths(str) {
let prev;
do {
prev = str;
str = str.replace(tmpLoc, "<CWD>");
} while (str !== prev);
return str;
}
describe("debug output", () => {
let cwd;
beforeEach(() => {
cwd = process.cwd();
});
afterEach(() => {
process.chdir(cwd);
});
fs.readdirSync(fixtureLoc).forEach(testName => {
if (testName.slice(0, 1) === ".") return;
const testLoc = path.join(fixtureLoc, testName);
const opts = {
args: ["src", "--out-dir", "lib"],
testLoc: testLoc,
};
const stdoutLoc = path.join(testLoc, "stdout.txt");
const stderrLoc = path.join(testLoc, "stderr.txt");
if (fs.existsSync(stdoutLoc)) {
opts.stdout = helper.readFile(stdoutLoc);
}
if (fs.existsSync(stderrLoc)) {
opts.stderr = helper.readFile(stderrLoc);
}
const optionsLoc = path.join(testLoc, "options.json");
if (!fs.existsSync(optionsLoc)) {
throw new Error(
`Debug test '${testName}' is missing an options.json file`,
);
}
const inFilesFolderLoc = path.join(testLoc, "in");
opts.inFiles = {
".babelrc": helper.readFile(optionsLoc),
};
if (!fs.existsSync(inFilesFolderLoc)) {
opts.inFiles["src/in.js"] = "";
} else {
fs.readdirSync(inFilesFolderLoc).forEach(filename => {
opts.inFiles[`src/${filename}`] = helper.readFile(
path.join(inFilesFolderLoc, filename),
);
});
}
it(testName, buildTest(opts));
});
});

View File

@ -1,13 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,13 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,10 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,13 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,10 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,13 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,10 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,13 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,10 +0,0 @@
{
"presets": [
["../../lib", {
"debug": true,
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"corejs": 3 "corejs": 3
}] }]

View File

@ -44,4 +44,3 @@ Using plugins:
proposal-dynamic-import {} proposal-dynamic-import {}
Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": [ "Android >= 4" ] "browsers": [ "Android >= 4" ]

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.copy-within { "android":"4" } es6.array.copy-within { "android":"4" }
es6.array.fill { "android":"4" } es6.array.fill { "android":"4" }
es6.array.find { "android":"4" } es6.array.find { "android":"4" }
@ -158,4 +158,3 @@ Using polyfills with `entry` option:
web.timers { "android":"4" } web.timers { "android":"4" }
web.immediate { "android":"4" } web.immediate { "android":"4" }
web.dom.iterable { "android":"4" } web.dom.iterable { "android":"4" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"electron": 0.36 "electron": 0.36

View File

@ -39,7 +39,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.every { "electron":"0.36" } es6.array.every { "electron":"0.36" }
es6.array.filter { "electron":"0.36" } es6.array.filter { "electron":"0.36" }
es7.array.flat-map { "electron":"0.36" } es7.array.flat-map { "electron":"0.36" }
@ -133,4 +133,3 @@ Using polyfills with `entry` option:
web.timers { "electron":"0.36" } web.timers { "electron":"0.36" }
web.immediate { "electron":"0.36" } web.immediate { "electron":"0.36" }
web.dom.iterable { "electron":"0.36" } web.dom.iterable { "electron":"0.36" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"modules": false, "modules": false,
"targets": { "targets": {

View File

@ -44,7 +44,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es7.array.flat-map { "chrome":"55" } es7.array.flat-map { "chrome":"55" }
es6.array.sort { "chrome":"55" } es6.array.sort { "chrome":"55" }
es7.object.define-getter { "chrome":"55" } es7.object.define-getter { "chrome":"55" }
@ -61,4 +61,3 @@ Using polyfills with `entry` option:
web.timers { "chrome":"55" } web.timers { "chrome":"55" }
web.immediate { "chrome":"55" } web.immediate { "chrome":"55" }
web.dom.iterable { "chrome":"55" } web.dom.iterable { "chrome":"55" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"node": 6 "node": 6

View File

@ -25,5 +25,4 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Import of core-js was not found. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/input.js] Import of @babel/polyfill was not found.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome 71" "browsers": "chrome 71"

View File

@ -17,8 +17,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
web.timers { "chrome":"71" } web.timers { "chrome":"71" }
web.immediate { "chrome":"71" } web.immediate { "chrome":"71" }
web.dom.iterable { "chrome":"71" } web.dom.iterable { "chrome":"71" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"useBuiltIns": "entry", "useBuiltIns": "entry",
"corejs": { "version": 2, "proposals": true } "corejs": { "version": 2, "proposals": true }

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.copy-within {} es6.array.copy-within {}
es6.array.every {} es6.array.every {}
es6.array.fill {} es6.array.fill {}
@ -192,4 +192,3 @@ Using polyfills with `entry` option:
web.timers {} web.timers {}
web.immediate {} web.immediate {}
web.dom.iterable {} web.dom.iterable {}
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome 71" "browsers": "chrome 71"

View File

@ -17,8 +17,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
web.timers { "chrome":"71" } web.timers { "chrome":"71" }
web.immediate { "chrome":"71" } web.immediate { "chrome":"71" }
web.dom.iterable { "chrome":"71" } web.dom.iterable { "chrome":"71" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"shippedProposals": true, "shippedProposals": true,
"useBuiltIns": "entry", "useBuiltIns": "entry",

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.copy-within {} es6.array.copy-within {}
es6.array.every {} es6.array.every {}
es6.array.fill {} es6.array.fill {}
@ -192,4 +192,3 @@ Using polyfills with `entry` option:
web.timers {} web.timers {}
web.immediate {} web.immediate {}
web.dom.iterable {} web.dom.iterable {}
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49" "browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49"

View File

@ -47,7 +47,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.copy-within { "ie":"10", "safari":"7" } es6.array.copy-within { "ie":"10", "safari":"7" }
es6.array.fill { "ie":"10", "safari":"7" } es6.array.fill { "ie":"10", "safari":"7" }
es6.array.find { "ie":"10", "safari":"7" } es6.array.find { "ie":"10", "safari":"7" }
@ -177,4 +177,3 @@ Using polyfills with `entry` option:
web.timers { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } web.timers { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.immediate { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } web.immediate { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
web.dom.iterable { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } web.dom.iterable { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"useBuiltIns": "entry", "useBuiltIns": "entry",
"corejs": 2, "corejs": 2,
"debug": true, "debug": true,

View File

@ -55,7 +55,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.copy-within { "ie":"10" } es6.array.copy-within { "ie":"10" }
es6.array.every { "electron":"0.36" } es6.array.every { "electron":"0.36" }
es6.array.fill { "ie":"10" } es6.array.fill { "ie":"10" }
@ -204,4 +204,3 @@ Using polyfills with `entry` option:
web.timers { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } web.timers { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
web.immediate { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } web.immediate { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
web.dom.iterable { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } web.dom.iterable { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"useBuiltIns": "entry", "useBuiltIns": "entry",
"corejs": 2, "corejs": 2,
"debug": true, "debug": true,

View File

@ -44,7 +44,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.copy-within { "ie":"10" } es6.array.copy-within { "ie":"10" }
es6.array.fill { "ie":"10" } es6.array.fill { "ie":"10" }
es6.array.find { "ie":"10" } es6.array.find { "ie":"10" }
@ -173,4 +173,3 @@ Using polyfills with `entry` option:
web.timers { "chrome":"54", "ie":"10", "node":"6.10" } web.timers { "chrome":"54", "ie":"10", "node":"6.10" }
web.immediate { "chrome":"54", "ie":"10", "node":"6.10" } web.immediate { "chrome":"54", "ie":"10", "node":"6.10" }
web.dom.iterable { "chrome":"54", "ie":"10", "node":"6.10" } web.dom.iterable { "chrome":"54", "ie":"10", "node":"6.10" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome >= 54, ie 10", "browsers": "chrome >= 54, ie 10",

View File

@ -44,7 +44,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced @babel/polyfill entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/input.mjs] Replaced @babel/polyfill entries with the following polyfills:
es6.array.copy-within { "ie":"10" } es6.array.copy-within { "ie":"10" }
es6.array.fill { "ie":"10" } es6.array.fill { "ie":"10" }
es6.array.find { "ie":"10" } es6.array.find { "ie":"10" }
@ -173,4 +173,3 @@ Using polyfills with `entry` option:
web.timers { "chrome":"54", "ie":"10", "node":"6" } web.timers { "chrome":"54", "ie":"10", "node":"6" }
web.immediate { "chrome":"54", "ie":"10", "node":"6" } web.immediate { "chrome":"54", "ie":"10", "node":"6" }
web.dom.iterable { "chrome":"54", "ie":"10", "node":"6" } web.dom.iterable { "chrome":"54", "ie":"10", "node":"6" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome 71" "browsers": "chrome 71"

View File

@ -17,7 +17,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/input.mjs] Replaced core-js entries with the following polyfills:
es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat { "chrome":"71" }
es.array.unscopables.flat-map { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" }
es.object.from-entries { "chrome":"71" } es.object.from-entries { "chrome":"71" }
@ -104,5 +104,4 @@ Using polyfills with `entry` option:
esnext.weak-set.of { "chrome":"71" } esnext.weak-set.of { "chrome":"71" }
web.immediate { "chrome":"71" } web.immediate { "chrome":"71" }
[<CWD>/src/in.js] Based on your targets, regenerator-runtime import excluded. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"shippedProposals": true, "shippedProposals": true,
"useBuiltIns": "entry", "useBuiltIns": "entry",

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/input.mjs] Replaced core-js entries with the following polyfills:
es.symbol {} es.symbol {}
es.symbol.description {} es.symbol.description {}
es.symbol.async-iterator {} es.symbol.async-iterator {}
@ -334,4 +334,3 @@ Using polyfills with `entry` option:
web.url {} web.url {}
web.url.to-json {} web.url.to-json {}
web.url-search-params {} web.url-search-params {}
Successfully compiled 1 file with Babel.

View File

@ -1,9 +1,11 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": [ "Android >= 4" ] "browsers": ["Android >= 4"]
}, },
"useBuiltIns": "entry", "useBuiltIns": "entry",
"corejs": 3 "corejs": 3

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/input.mjs] Replaced core-js entries with the following polyfills:
es.symbol { "android":"4" } es.symbol { "android":"4" }
es.symbol.description { "android":"4" } es.symbol.description { "android":"4" }
es.symbol.async-iterator { "android":"4" } es.symbol.async-iterator { "android":"4" }
@ -247,4 +247,3 @@ Using polyfills with `entry` option:
web.url { "android":"4" } web.url { "android":"4" }
web.url.to-json { "android":"4" } web.url.to-json { "android":"4" }
web.url-search-params { "android":"4" } web.url-search-params { "android":"4" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"shippedProposals": true, "shippedProposals": true,
"useBuiltIns": "entry", "useBuiltIns": "entry",

View File

@ -43,5 +43,4 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Import of core-js was not found. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/input.mjs] Import of core-js was not found.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"electron": 0.36 "electron": 0.36

View File

@ -39,7 +39,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/input.mjs] Replaced core-js entries with the following polyfills:
es.symbol { "electron":"0.36" } es.symbol { "electron":"0.36" }
es.symbol.description { "electron":"0.36" } es.symbol.description { "electron":"0.36" }
es.symbol.async-iterator { "electron":"0.36" } es.symbol.async-iterator { "electron":"0.36" }
@ -135,4 +135,3 @@ Using polyfills with `entry` option:
web.url { "electron":"0.36" } web.url { "electron":"0.36" }
web.url.to-json { "electron":"0.36" } web.url.to-json { "electron":"0.36" }
web.url-search-params { "electron":"0.36" } web.url-search-params { "electron":"0.36" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome 71" "browsers": "chrome 71"

View File

@ -17,10 +17,9 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs] Replaced core-js entries with the following polyfills:
es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat { "chrome":"71" }
es.array.unscopables.flat-map { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" }
es.object.from-entries { "chrome":"71" } es.object.from-entries { "chrome":"71" }
[<CWD>/src/in.js] Based on your targets, regenerator-runtime import excluded. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome 71" "browsers": "chrome 71"

View File

@ -17,7 +17,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs] Replaced core-js entries with the following polyfills:
es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat { "chrome":"71" }
es.array.unscopables.flat-map { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" }
es.object.from-entries { "chrome":"71" } es.object.from-entries { "chrome":"71" }
@ -103,5 +103,4 @@ Using polyfills with `entry` option:
esnext.weak-set.from { "chrome":"71" } esnext.weak-set.from { "chrome":"71" }
esnext.weak-set.of { "chrome":"71" } esnext.weak-set.of { "chrome":"71" }
[<CWD>/src/in.js] Based on your targets, regenerator-runtime import excluded. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"shippedProposals": true, "shippedProposals": true,
"useBuiltIns": "entry", "useBuiltIns": "entry",

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/input.mjs] Replaced core-js entries with the following polyfills:
es.symbol {} es.symbol {}
es.symbol.description {} es.symbol.description {}
es.symbol.async-iterator {} es.symbol.async-iterator {}
@ -329,4 +329,3 @@ Using polyfills with `entry` option:
web.url {} web.url {}
web.url.to-json {} web.url.to-json {}
web.url-search-params {} web.url-search-params {}
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"shippedProposals": true, "shippedProposals": true,
"useBuiltIns": "entry", "useBuiltIns": "entry",

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/input.mjs] Replaced core-js entries with the following polyfills:
es.symbol {} es.symbol {}
es.symbol.description {} es.symbol.description {}
es.symbol.async-iterator {} es.symbol.async-iterator {}
@ -244,4 +244,3 @@ Using polyfills with `entry` option:
es.typed-array.to-string {} es.typed-array.to-string {}
es.weak-map {} es.weak-map {}
es.weak-set {} es.weak-set {}
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"modules": false, "modules": false,
"targets": { "targets": {

View File

@ -44,7 +44,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/input.mjs] Replaced core-js entries with the following polyfills:
es.symbol.description { "chrome":"55" } es.symbol.description { "chrome":"55" }
es.symbol.async-iterator { "chrome":"55" } es.symbol.async-iterator { "chrome":"55" }
es.array.flat { "chrome":"55" } es.array.flat { "chrome":"55" }
@ -73,4 +73,3 @@ Using polyfills with `entry` option:
web.url { "chrome":"55" } web.url { "chrome":"55" }
web.url.to-json { "chrome":"55" } web.url.to-json { "chrome":"55" }
web.url-search-params { "chrome":"55" } web.url-search-params { "chrome":"55" }
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"node": 6 "node": 6

View File

@ -25,5 +25,4 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Import of @babel/polyfill was not found. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/input.js] Import of core-js was not found.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome 71" "browsers": "chrome 71"

View File

@ -17,7 +17,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/input.mjs] Replaced core-js entries with the following polyfills:
esnext.aggregate-error { "chrome":"71" } esnext.aggregate-error { "chrome":"71" }
esnext.array.last-index { "chrome":"71" } esnext.array.last-index { "chrome":"71" }
esnext.array.last-item { "chrome":"71" } esnext.array.last-item { "chrome":"71" }
@ -100,5 +100,4 @@ Using polyfills with `entry` option:
esnext.weak-set.from { "chrome":"71" } esnext.weak-set.from { "chrome":"71" }
esnext.weak-set.of { "chrome":"71" } esnext.weak-set.of { "chrome":"71" }
[<CWD>/src/in.js] Based on your targets, regenerator-runtime import excluded. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded.
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"useBuiltIns": "entry", "useBuiltIns": "entry",
"corejs": { "version": 3, "proposals": true } "corejs": { "version": 3, "proposals": true }

View File

@ -43,7 +43,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/input.mjs] Replaced core-js entries with the following polyfills:
esnext.aggregate-error {} esnext.aggregate-error {}
esnext.array.last-index {} esnext.array.last-index {}
esnext.array.last-item {} esnext.array.last-item {}
@ -129,4 +129,3 @@ Using polyfills with `entry` option:
web.url {} web.url {}
web.url.to-json {} web.url.to-json {}
web.url-search-params {} web.url-search-params {}
Successfully compiled 1 file with Babel.

View File

@ -1,6 +1,8 @@
{ {
"validateLogs": true,
"ignoreOutput": true,
"presets": [ "presets": [
["../../lib", { ["env", {
"debug": true, "debug": true,
"targets": { "targets": {
"browsers": "chrome 71" "browsers": "chrome 71"

View File

@ -0,0 +1,22 @@
@babel/preset-env: `DEBUG` option
Using targets:
{
"chrome": "71"
}
Using modules transform: auto
Using plugins:
syntax-async-generators { "chrome":"71" }
syntax-object-rest-spread { "chrome":"71" }
syntax-json-strings { "chrome":"71" }
syntax-optional-catch-binding { "chrome":"71" }
transform-modules-commonjs { "chrome":"71" }
proposal-dynamic-import { "chrome":"71" }
Using polyfills with `entry` option:
[<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/input.mjs] Import of core-js was not found.
[<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded.

View File

@ -0,0 +1,15 @@
{
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -17,7 +17,6 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Import of core-js was not found. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/input.mjs] Import of core-js was not found.
[<CWD>/src/in.js] Based on your targets, regenerator-runtime import excluded. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/input.mjs] Based on your targets, regenerator-runtime import excluded.
Successfully compiled 1 file with Babel.

View File

@ -0,0 +1,15 @@
{
"validateLogs": true,
"ignoreOutput": true,
"presets": [
["env", {
"debug": true,
"targets": {
"browsers": "chrome 71"
},
"shippedProposals": true,
"useBuiltIns": "entry",
"corejs": 3
}]
]
}

View File

@ -17,7 +17,7 @@ Using plugins:
Using polyfills with `entry` option: Using polyfills with `entry` option:
[<CWD>/src/in.js] Replaced core-js entries with the following polyfills: [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/input.mjs] Replaced core-js entries with the following polyfills:
es.object.from-entries { "chrome":"71" } es.object.from-entries { "chrome":"71" }
esnext.reflect.define-metadata { "chrome":"71" } esnext.reflect.define-metadata { "chrome":"71" }
esnext.reflect.delete-metadata { "chrome":"71" } esnext.reflect.delete-metadata { "chrome":"71" }
@ -29,5 +29,4 @@ Using polyfills with `entry` option:
esnext.reflect.has-own-metadata { "chrome":"71" } esnext.reflect.has-own-metadata { "chrome":"71" }
esnext.reflect.metadata { "chrome":"71" } esnext.reflect.metadata { "chrome":"71" }
[<CWD>/src/in.js] Based on your targets, regenerator-runtime import excluded. [<CWD>/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded.
Successfully compiled 1 file with Babel.

Some files were not shown because too many files have changed in this diff Show More