bind additional Assert functions#29
Conversation
illusionalsagacity
commented
Jan 22, 2025
- notEqual
- notDeepEqual
- strictEqual
- notStrictEqual
- deepStrictEqual
- fail
cometkim
left a comment
There was a problem hiding this comment.
Nitpicking, but can you replace it with t->expect style?
Maybe I should change the binding to t => x => expected instead of (t, x) => expected later version 🤔
- notEqual - notDeepEqual - strictEqual - notStrictEqual - deepStrictEqual - fail
e69036e to
adfddaa
Compare
Hmm, I kinda like that, you could alias expect in the start of your test function more easily that way too: test("blah", t => {
let expect = expect(t)
...
}) |
|
@cometkim any others you think would be useful? I think these would be the most common for use in let a = ref(0)
let b = ref(0.)
await waitFor(() => {
Assert.Int.isAbove(a.contents, 0, ~message="a is 0")
})
await waitFor(() => {
Assert.Float.isAbove(b.contents, 0., ~message="b is 0.")
}) |
|
Well, I'm not a fan of exposing a bloated API surface upfront by providing bindings. Some should strictly follow the binding style, but users should easily add or extend simple helper methods themselves. Most submodules of |
Are there any functions in here you would prefer not to be merged? Regardless I will leave out any more, to your point they should be straightforward enough to bind in consumer's projects |
|
If you use it in your project and you want to upstream it. I will merge unless there is a style conflict. Otherwise we can open issue and discuss first |