Skip to content

Commit

Permalink
add Babel 8 test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Mar 4, 2022
1 parent ac78f15 commit 52d9cf5
Showing 1 changed file with 45 additions and 20 deletions.
Expand Up @@ -19,25 +19,50 @@ describe("normalizeParserOptions", () => {
expect(result).toHaveProperty("configFile", undefined);
});
});
it("default parserOpts", () => {
const result = normalizeParserOptions({ requireConfigFile: false });
expect(result.parserOpts).toMatchInlineSnapshot(`
Object {
"allowImportExportEverywhere": false,
"allowReturnOutsideFunction": true,
"allowSuperOutsideMethod": true,
"attachComment": false,
"plugins": Array [
Array [
"estree",
Object {
"classFeatures": false,
},
(process.env.BABEL_8_BREAKING ? it.skip : it)(
"Babel 7 default parserOpts",
() => {
const result = normalizeParserOptions({ requireConfigFile: false });
expect(result.parserOpts).toMatchInlineSnapshot(`
Object {
"allowImportExportEverywhere": false,
"allowReturnOutsideFunction": true,
"allowSuperOutsideMethod": true,
"attachComment": false,
"plugins": Array [
Array [
"estree",
Object {
"classFeatures": false,
},
],
],
"ranges": true,
"tokens": true,
}
`);
},
);
(process.env.BABEL_8_BREAKING ? it : it.skip)(
"Babel 8 default parserOpts",
() => {
const result = normalizeParserOptions({ requireConfigFile: false });
expect(result.parserOpts).toMatchInlineSnapshot(`
Object {
"allowReturnOutsideFunction": false,
"attachComment": false,
"plugins": Array [
Array [
"estree",
Object {
"classFeatures": false,
},
],
],
],
"ranges": true,
"tokens": true,
}
`);
});
"ranges": true,
"tokens": true,
}
`);
},
);
});

0 comments on commit 52d9cf5

Please sign in to comment.