-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: π set
allowExportNames
for react-refresh & nextjs
- Loading branch information
1 parent
020f0c1
commit 957e5af
Showing
4 changed files
with
65 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
import { isPackageExists } from "local-pkg"; | ||
|
||
import { reactRules } from "./react"; | ||
|
||
test("should create react rules", async () => { | ||
await expect(reactRules()).resolves.toMatchSnapshot(); | ||
vi.mock("local-pkg"); | ||
|
||
describe("reactRules", () => { | ||
it("should create react rules", async () => { | ||
await expect(reactRules()).resolves.toMatchSnapshot(); | ||
}); | ||
|
||
it("should add allowExportNames for nextjs", async () => { | ||
vi.mocked(isPackageExists).mockImplementation((name) => { | ||
return name === "next"; | ||
}); | ||
|
||
const rules = await reactRules(); | ||
|
||
const allowExportNames = | ||
rules["react-refresh/only-export-components"][1].allowExportNames; | ||
|
||
expect(allowExportNames).toMatchInlineSnapshot(` | ||
[ | ||
"dynamic", | ||
"dynamicParams", | ||
"revalidate", | ||
"fetchCache", | ||
"runtime", | ||
"preferredRegion", | ||
"maxDuration", | ||
"config", | ||
"generateStaticParams", | ||
"metadata", | ||
"generateMetadata", | ||
"viewport", | ||
"generateViewport", | ||
] | ||
`); | ||
}); | ||
}); |
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