mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
chore: Update to not skip one test
This commit is contained in:
@@ -11,101 +11,108 @@ const todo = <A>(): A => {
|
|||||||
}
|
}
|
||||||
const noop = () => {}
|
const noop = () => {}
|
||||||
describe("wrapperData", () => {
|
describe("wrapperData", () => {
|
||||||
test.skip("types", async () => {
|
test("types", async () => {
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("/config", {
|
;async () => {
|
||||||
someValue: "a",
|
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("/config", {
|
||||||
})
|
someValue: "a",
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
})
|
||||||
"/config/someValue",
|
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
||||||
"b",
|
"/config/someValue",
|
||||||
)
|
"b",
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("", {
|
)
|
||||||
config: { someValue: "b" },
|
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("", {
|
||||||
})
|
config: { someValue: "b" },
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
})
|
||||||
"/config/someValue",
|
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
||||||
|
"/config/someValue",
|
||||||
|
|
||||||
// @ts-expect-error Type is wrong for the setting value
|
// @ts-expect-error Type is wrong for the setting value
|
||||||
5,
|
5,
|
||||||
)
|
)
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
"/config/someVae3lue",
|
"/config/someVae3lue",
|
||||||
"someValue",
|
"someValue",
|
||||||
)
|
)
|
||||||
|
|
||||||
todo<T.Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
todo<T.Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
||||||
path: "/config/someValue",
|
path: "/config/someValue",
|
||||||
value: "b",
|
value: "b",
|
||||||
})
|
})
|
||||||
todo<T.Effects>().setWrapperData<WrapperType, "/config/some2Value">({
|
todo<T.Effects>().setWrapperData<WrapperType, "/config/some2Value">({
|
||||||
//@ts-expect-error Path is wrong
|
//@ts-expect-error Path is wrong
|
||||||
path: "/config/someValue",
|
path: "/config/someValue",
|
||||||
//@ts-expect-error Path is wrong
|
//@ts-expect-error Path is wrong
|
||||||
value: "someValueIn",
|
value: "someValueIn",
|
||||||
})
|
})
|
||||||
todo<T.Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
todo<T.Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
||||||
//@ts-expect-error Path is wrong
|
//@ts-expect-error Path is wrong
|
||||||
path: "/config/some2Value",
|
path: "/config/some2Value",
|
||||||
value: "a",
|
value: "a",
|
||||||
})
|
})
|
||||||
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
||||||
.getOwnWrapperData("/config/someValue")
|
.getOwnWrapperData("/config/someValue")
|
||||||
.const()) satisfies string
|
.const()) satisfies string
|
||||||
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
||||||
.getOwnWrapperData("/config")
|
.getOwnWrapperData("/config")
|
||||||
.const()) satisfies WrapperType["config"]
|
.const()) satisfies WrapperType["config"]
|
||||||
await utils<WrapperType, {}>(todo<T.Effects>())
|
await utils<WrapperType, {}>(todo<T.Effects>())
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
.getOwnWrapperData("/config/somdsfeValue")
|
.getOwnWrapperData("/config/somdsfeValue")
|
||||||
.const()
|
.const()
|
||||||
/// ----------------- ERRORS -----------------
|
/// ----------------- ERRORS -----------------
|
||||||
|
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("", {
|
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("", {
|
||||||
// @ts-expect-error Type is wrong for the setting value
|
// @ts-expect-error Type is wrong for the setting value
|
||||||
config: { someValue: "notInAOrB" },
|
config: { someValue: "notInAOrB" },
|
||||||
})
|
})
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
||||||
"/config/someValue",
|
"/config/someValue",
|
||||||
// @ts-expect-error Type is wrong for the setting value
|
// @ts-expect-error Type is wrong for the setting value
|
||||||
"notInAOrB",
|
"notInAOrB",
|
||||||
)
|
)
|
||||||
;(await utils<WrapperType>(todo<T.Effects>())
|
;(await utils<WrapperType>(todo<T.Effects>())
|
||||||
.getOwnWrapperData("/config/someValue")
|
.getOwnWrapperData("/config/someValue")
|
||||||
// @ts-expect-error Const should normally not be callable
|
// @ts-expect-error Const should normally not be callable
|
||||||
.const()) satisfies string
|
.const()) satisfies string
|
||||||
;(await utils<WrapperType>(todo<T.Effects>())
|
;(await utils<WrapperType>(todo<T.Effects>())
|
||||||
.getOwnWrapperData("/config")
|
.getOwnWrapperData("/config")
|
||||||
// @ts-expect-error Const should normally not be callable
|
// @ts-expect-error Const should normally not be callable
|
||||||
.const()) satisfies WrapperType["config"]
|
.const()) satisfies WrapperType["config"]
|
||||||
await utils<WrapperType>(todo<T.Effects>())
|
await utils<WrapperType>(todo<T.Effects>())
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
.getOwnWrapperData("/config/somdsfeValue")
|
.getOwnWrapperData("/config/somdsfeValue")
|
||||||
// @ts-expect-error Const should normally not be callable
|
// @ts-expect-error Const should normally not be callable
|
||||||
.const()
|
.const()
|
||||||
|
|
||||||
///
|
///
|
||||||
;(await utils<WrapperType>(todo<T.Effects>())
|
;(await utils<WrapperType>(todo<T.Effects>())
|
||||||
.getOwnWrapperData("/config/someValue")
|
.getOwnWrapperData("/config/someValue")
|
||||||
// @ts-expect-error satisfies type is wrong
|
// @ts-expect-error satisfies type is wrong
|
||||||
.const()) satisfies number
|
.const()) satisfies number
|
||||||
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
.getOwnWrapperData("/config/")
|
.getOwnWrapperData("/config/")
|
||||||
.const()) satisfies WrapperType["config"]
|
.const()) satisfies WrapperType["config"]
|
||||||
;(await todo<T.Effects>().getWrapperData<WrapperType, "/config/someValue">({
|
;(await todo<T.Effects>().getWrapperData<
|
||||||
path: "/config/someValue",
|
WrapperType,
|
||||||
callback: noop,
|
"/config/someValue"
|
||||||
})) satisfies string
|
>({
|
||||||
await todo<T.Effects>().getWrapperData<WrapperType, "/config/someValue">({
|
path: "/config/someValue",
|
||||||
// @ts-expect-error Path is wrong as in it doesn't match above
|
callback: noop,
|
||||||
path: "/config/someV2alue",
|
})) satisfies string
|
||||||
callback: noop,
|
await todo<T.Effects>().getWrapperData<WrapperType, "/config/someValue">({
|
||||||
})
|
// @ts-expect-error Path is wrong as in it doesn't match above
|
||||||
await todo<T.Effects>().getWrapperData<WrapperType, "/config/someV2alue">({
|
path: "/config/someV2alue",
|
||||||
// @ts-expect-error Path is wrong as in it doesn't exists in wrapper type
|
callback: noop,
|
||||||
path: "/config/someV2alue",
|
})
|
||||||
callback: noop,
|
await todo<T.Effects>().getWrapperData<WrapperType, "/config/someV2alue">(
|
||||||
})
|
{
|
||||||
|
// @ts-expect-error Path is wrong as in it doesn't exists in wrapper type
|
||||||
|
path: "/config/someV2alue",
|
||||||
|
callback: noop,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user