Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add missing available plugins to babel-preset-env-standalone (#1…
…0732) * fix: add missing available plugins to babel-preset-env-standalone * skip available-plugins test in CI coverage test
- Loading branch information
Showing
4 changed files
with
26 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
packages/babel-preset-env-standalone/test/available-plugins.js
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,19 @@ | ||
import expectedAvailablePlugins from "@babel/preset-env/lib/available-plugins"; | ||
import difference from "lodash/difference"; | ||
|
||
// build-babel-preset-env-standalone in CI coverage tests is skipped, so we skip this test as well | ||
(process.env.TEST_TYPE === "cov" ? describe.skip : describe)( | ||
"available-plugins", | ||
() => { | ||
const actualAvailablePlugins = require("../lib/available-plugins").default; | ||
it("should be a superset of available-plugins in @babel/preset-env", () => { | ||
const expectedPluginList = Object.keys(expectedAvailablePlugins); | ||
expectedPluginList.sort(); | ||
|
||
const actualPluginList = Object.keys(actualAvailablePlugins); | ||
actualPluginList.sort(); | ||
// If this test is failed, add the missing plugins to ./src/available-plugins | ||
expect(difference(expectedPluginList, actualPluginList)).toEqual([]); | ||
}); | ||
}, | ||
); |
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