extend("test")
extend("flow")
describe("flow:errors", () => {
it("throttle rejects negative milliseconds", () => {
test:expect_error(() => {
flow:throttle(-5, ink(1,3))
}, "negative ms")
})
it("filter requires a function predicate", () => {
test:expect_error(() => {
flow:filter(123, ink(1,3))
}, "first param")
})
it("slice requires integer skip", () => {
test:expect_error(() => {
flow:slice("a", 3, ink(1,3))
}, "skip")
})
it("slice requires integer count", () => {
test:expect_error(() => {
flow:slice(1, "b", ink(1,3))
}, "count")
})
it("slice requires iterator or transform source", () => {
test:expect_error(() => {
flow:slice(1, 2, 99)
}, "InkIterator or InkTransform")
})
})