-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSome.spec.ts
More file actions
19 lines (18 loc) · 926 Bytes
/
Some.spec.ts
File metadata and controls
19 lines (18 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import * as selectively from "./index"
describe("some", () => {
it("simple", () =>
expect(
selectively.is({ status: selectively.some("approved") }, { id: "axb", status: ["denied", "approved"] })
).toBeTruthy())
it("negative", () =>
expect(
selectively.is({ status: selectively.some("approved") }, { id: "axb", status: ["denied", "returned"] })
).toBeFalsy())
it("other", () => {
expect(selectively.is(selectively.some("value"), ["value", "not value", "3rd array item"])).toEqual(true)
expect(selectively.is(selectively.some("not value"), ["value", "not value", "3rd array item"])).toEqual(true)
expect(selectively.is(selectively.some("cant find"), ["value", "not value", "3rd array item"])).toEqual(false)
expect(selectively.some("value", ["value", "not value", "3rd array item"])).toEqual(true)
expect(selectively.some("cant find", ["value", "not value", "3rd array item"])).toEqual(false)
})
})