Skip to content

Commit

Permalink
chore: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed May 13, 2024
1 parent 4517b30 commit 589a8a7
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 1 deletion.
19 changes: 19 additions & 0 deletions tests/__snapshots__/problem-esm-react-eslint8.x-javascript
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"configContent": "import globals from "globals";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";


export default [
{languageOptions: { globals: globals.browser }},
pluginReactConfig,
];",
"configFilename": "eslint.config.js",
"devDependencies": [
"eslint@8.x",
"globals",
"eslint-plugin-react",
],
"installFlags": [
"-D",
],
}
22 changes: 22 additions & 0 deletions tests/__snapshots__/problem-esm-react-eslint8.x-typescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"configContent": "import globals from "globals";
import tseslint from "typescript-eslint";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";


export default [
{languageOptions: { globals: globals.browser }},
...tseslint.configs.recommended,
pluginReactConfig,
];",
"configFilename": "eslint.config.js",
"devDependencies": [
"eslint@8.x",
"globals",
"typescript-eslint",
"eslint-plugin-react",
],
"installFlags": [
"-D",
],
}
22 changes: 22 additions & 0 deletions tests/__snapshots__/problem-esm-react-eslint9.x-javascript
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"configContent": "import globals from "globals";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import { fixupConfigRules } from "@eslint/compat";


export default [
{languageOptions: { globals: globals.browser }},
...fixupConfigRules(pluginReactConfig),
];",
"configFilename": "eslint.config.js",
"devDependencies": [
"eslint@9.x",
"globals",
"eslint-plugin-react",
"@eslint/compat",
],
"installFlags": [
"-D",
"--force",
],
}
25 changes: 25 additions & 0 deletions tests/__snapshots__/problem-esm-react-eslint9.x-typescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"configContent": "import globals from "globals";
import tseslint from "typescript-eslint";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import { fixupConfigRules } from "@eslint/compat";


export default [
{languageOptions: { globals: globals.browser }},
...tseslint.configs.recommended,
...fixupConfigRules(pluginReactConfig),
];",
"configFilename": "eslint.config.js",
"devDependencies": [
"eslint@9.x",
"globals",
"typescript-eslint",
"eslint-plugin-react",
"@eslint/compat",
],
"installFlags": [
"-D",
"--force",
],
}
6 changes: 5 additions & 1 deletion tests/config-snapshots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ describe("generate config for esm projects", () => {
{ name: "syntax-esm-react-eslint8.x-javascript", answers: { purpose: "syntax", moduleType: "esm", framework: "react", eslintVersion: "8.x", language: "javascript", env: ["browser"] } },
{ name: "syntax-esm-react-eslint8.x-typescript", answers: { purpose: "syntax", moduleType: "esm", framework: "react", eslintVersion: "8.x", language: "typescript", env: ["browser"] } },
{ name: "syntax-esm-react-eslint9.x-javascript", answers: { purpose: "syntax", moduleType: "esm", framework: "react", eslintVersion: "9.x", language: "javascript", env: ["browser"] } },
{ name: "syntax-esm-react-eslint9.x-typescript", answers: { purpose: "syntax", moduleType: "esm", framework: "react", eslintVersion: "9.x", language: "typescript", env: ["browser"] } }
{ name: "syntax-esm-react-eslint9.x-typescript", answers: { purpose: "syntax", moduleType: "esm", framework: "react", eslintVersion: "9.x", language: "typescript", env: ["browser"] } },
{ name: "problem-esm-react-eslint8.x-javascript", answers: { purpose: "problem", moduleType: "esm", framework: "react", eslintVersion: "8.x", language: "javascript", env: ["browser"] } },
{ name: "problem-esm-react-eslint8.x-typescript", answers: { purpose: "problem", moduleType: "esm", framework: "react", eslintVersion: "8.x", language: "typescript", env: ["browser"] } },
{ name: "problem-esm-react-eslint9.x-javascript", answers: { purpose: "problem", moduleType: "esm", framework: "react", eslintVersion: "9.x", language: "javascript", env: ["browser"] } },
{ name: "problem-esm-react-eslint9.x-typescript", answers: { purpose: "problem", moduleType: "esm", framework: "react", eslintVersion: "9.x", language: "typescript", env: ["browser"] } }
];

// generate all possible combinations
Expand Down

0 comments on commit 589a8a7

Please sign in to comment.