-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc94b24
commit 1152222
Showing
11 changed files
with
139 additions
and
218 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"shoehorn": minor | ||
--- | ||
|
||
Figured out name for library and reduced API surface area. |
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
This file was deleted.
Oops, something went wrong.
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,3 +1,2 @@ | ||
export * from "./types"; | ||
export * from "./utils"; | ||
export * from "./createFixture"; |
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,21 +1,14 @@ | ||
import { it } from "vitest"; | ||
import { createFixture } from "./createFixture"; | ||
import { fromAny, fromPartial, fromExact } from "./utils"; | ||
import { fromAny, fromPartial } from "./utils"; | ||
|
||
type User = { | ||
id: string; | ||
name: string; | ||
type Request = { | ||
body: { | ||
id: string; | ||
}; | ||
// Imagine oodles of other properties... | ||
}; | ||
|
||
const func = (user: User) => {}; | ||
// The function we're testing | ||
const requiresRequest = (request: Request) => {}; | ||
|
||
const baseUser = createFixture<User>().set({ | ||
id: "123123", | ||
name: "awdawd", | ||
}); | ||
|
||
it("Should work", () => { | ||
func(baseUser.fromExact({})); | ||
}); | ||
|
||
const getUserId = (user: User) => {}; | ||
requiresRequest(fromAny("1234123")); |
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
Oops, something went wrong.