-
-
Notifications
You must be signed in to change notification settings - Fork 104
Supersede #910: entry shape test with lint unblock #919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
0015094
6011002
a78b76f
3b59b57
9e90e2d
8f94bfd
1b8a2b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -56,6 +56,25 @@ describe("Base config", () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(baseConfig.entry["generated/something"]).toBeUndefined() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("keeps entry value shapes stable for TypeScript narrowing", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const entryValues = Object.values(baseConfig.entry) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const stringEntries = entryValues.filter( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (entryValue) => typeof entryValue === "string" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const arrayEntries = entryValues.filter(Array.isArray) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(stringEntries.length + arrayEntries.length).toBe( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| entryValues.length | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
justin808 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrayEntries.forEach((entryValue) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(entryValue.length).toBeGreaterThan(0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| entryValue.forEach((value) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(typeof value).toBe("string") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
justin808 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Comment on lines
+68
to
+81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Prefer individual assertions per entry using
Suggested change
This way, a failure names the offending value directly. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("should returns top level and nested entry points with config.nested_entries == true", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process.env.SHAKAPACKER_CONFIG = "config/shakapacker_nested_entries.yml" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const config2 = require("../../../package/config") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.