Optionally enable external-helpers in tests (#12982)

* Optionally enable external-helpers in tests

https://github.com/babel/babel/pull/12911 was a breaking change that now requires you to keep `babel-plugin-external-helpers` in your `package.json`. It'll will probably be unnoticeable for most, because another dependency could transitively depend on it, but AMP recently hit it when cleaning up our deps.

* Cast to boolean

* Fix package name
This commit is contained in:
Justin Ridgewell 2021-03-08 16:58:30 -05:00 committed by GitHub
parent c702895256
commit 49a9b70cb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -135,7 +135,9 @@ function pushTask(taskName, taskDir, suite, suiteName) {
? taskOpts.BABEL_8_BREAKING === false ? taskOpts.BABEL_8_BREAKING === false
: taskOpts.BABEL_8_BREAKING === true), : taskOpts.BABEL_8_BREAKING === true),
options: taskOpts, options: taskOpts,
externalHelpers: taskOpts.externalHelpers ?? true, externalHelpers:
taskOpts.externalHelpers ??
!!tryResolve("@babel/plugin-external-helpers"),
validateLogs: taskOpts.validateLogs, validateLogs: taskOpts.validateLogs,
ignoreOutput: taskOpts.ignoreOutput, ignoreOutput: taskOpts.ignoreOutput,
stdout: { loc: stdoutLoc, code: readFile(stdoutLoc) }, stdout: { loc: stdoutLoc, code: readFile(stdoutLoc) },