Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow testing logs with
@babel/helper-transform-fixture-test-runner
(…
…#10326) * Add support for logs to transform-fixture-test-runner * Test some warnings * Use stderr/stdout, and add a validateLogs test option * Normalize CWD in logs and rename vars * Silence preset-env tests * Restore old methods
- Loading branch information
1 parent
75090f1
commit 469a5a7
Showing
21 changed files
with
185 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...s/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"validateLogs": true, | ||
"plugins": [ | ||
"syntax-dynamic-import", | ||
"transform-modules-systemjs", | ||
|
3 changes: 3 additions & 0 deletions
3
...ges/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/stderr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
WARNING: Dynamic import() transformation must be enabled using the | ||
@babel/plugin-proposal-dynamic-import plugin. Babel 8 will | ||
no longer transform import() without using that plugin. |
1 change: 1 addition & 0 deletions
1
...ages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [ | ||
[ | ||
"../../../../lib", | ||
|
33 changes: 33 additions & 0 deletions
33
packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@babel/preset-env: `DEBUG` option | ||
|
||
Using targets: | ||
{ | ||
"chrome": "61", | ||
"edge": "16", | ||
"firefox": "60", | ||
"ios": "10.3", | ||
"opera": "48", | ||
"safari": "10.1" | ||
} | ||
|
||
Using modules transform: false | ||
|
||
Using plugins: | ||
transform-template-literals { "ios":"10.3", "safari":"10.1" } | ||
transform-function-name { "edge":"16" } | ||
transform-dotall-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
transform-unicode-regex { "ios":"10.3", "safari":"10.1" } | ||
transform-parameters { "edge":"16" } | ||
transform-block-scoping { "ios":"10.3", "safari":"10.1" } | ||
transform-async-to-generator { "ios":"10.3", "safari":"10.1" } | ||
proposal-async-generator-functions { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
proposal-object-rest-spread { "edge":"16", "ios":"10.3", "safari":"10.1" } | ||
proposal-unicode-property-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
|
||
Using polyfills with `usage` option: | ||
|
||
[<CWD>/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/input.mjs] Added following core-js polyfill: | ||
web.dom.iterable { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } |
Empty file.
1 change: 1 addition & 0 deletions
1
...ages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [ | ||
[ | ||
"../../../../lib", | ||
|
34 changes: 34 additions & 0 deletions
34
packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@babel/preset-env: `DEBUG` option | ||
|
||
Using targets: | ||
{ | ||
"chrome": "61", | ||
"edge": "16", | ||
"firefox": "60", | ||
"ios": "10.3", | ||
"opera": "48", | ||
"safari": "10.1" | ||
} | ||
|
||
Using modules transform: false | ||
|
||
Using plugins: | ||
transform-template-literals { "ios":"10.3", "safari":"10.1" } | ||
transform-function-name { "edge":"16" } | ||
transform-dotall-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
transform-unicode-regex { "ios":"10.3", "safari":"10.1" } | ||
transform-parameters { "edge":"16" } | ||
transform-block-scoping { "ios":"10.3", "safari":"10.1" } | ||
transform-async-to-generator { "ios":"10.3", "safari":"10.1" } | ||
proposal-async-generator-functions { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
proposal-object-rest-spread { "edge":"16", "ios":"10.3", "safari":"10.1" } | ||
proposal-unicode-property-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } | ||
|
||
Using polyfills with `usage` option: | ||
|
||
[<CWD>/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/input.mjs] Added following core-js polyfills: | ||
es.array.iterator { "chrome":"61", "opera":"48" } | ||
web.dom-collections.iterator { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } |
1 change: 1 addition & 0 deletions
1
...-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-supported/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"validateLogs": true, | ||
"caller": { | ||
"name": "test-fixture", | ||
"supportsStaticESM": true, | ||
|
1 change: 1 addition & 0 deletions
1
...reset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"validateLogs": true, | ||
"caller": { | ||
"name": "test-fixture", | ||
"supportsStaticESM": true, | ||
|
1 change: 1 addition & 0 deletions
1
...-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/stderr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dynamic import can only be supported when transforming ES modules to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled. |
1 change: 1 addition & 0 deletions
1
...set-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"validateLogs": true, | ||
"caller": { | ||
"name": "test-fixture", | ||
"supportsStaticESM": false, | ||
|
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [["env", { "modules": "amd" }]] | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [["env", { "modules": "cjs" }]] | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/dynamic-import/modules-false/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [["env", { "modules": false }]] | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/dynamic-import/modules-systemjs/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [["env", { "modules": "systemjs" }]] | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [["env", { "modules": "umd" }]] | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/stderr.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dynamic import can only be supported when transforming ES modules to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled. |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"validateLogs": true, | ||
"presets": [ | ||
[ | ||
"../../../../lib", | ||
|
24 changes: 24 additions & 0 deletions
24
packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@babel/preset-env: `DEBUG` option | ||
|
||
Using targets: | ||
{ | ||
"safari": "10" | ||
} | ||
|
||
Using modules transform: auto | ||
|
||
Using plugins: | ||
transform-template-literals { "safari":"10" } | ||
transform-dotall-regex { "safari":"10" } | ||
transform-unicode-regex { "safari":"10" } | ||
transform-block-scoping { "safari":"10" } | ||
transform-exponentiation-operator { "safari":"10" } | ||
transform-async-to-generator { "safari":"10" } | ||
proposal-async-generator-functions { "safari":"10" } | ||
proposal-object-rest-spread { "safari":"10" } | ||
proposal-unicode-property-regex { "safari":"10" } | ||
proposal-json-strings { "safari":"10" } | ||
proposal-optional-catch-binding { "safari":"10" } | ||
transform-named-capturing-groups-regex { "safari":"10" } | ||
|
||
Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. |