Repository navigation
Feature/consilio fix delete - #53
Conversation
There was a problem hiding this comment.
🤖 Auto-Approved: PR author (@unilynx) is an internal organization/repository member.
| * @param toggle.run - The function to run | ||
| * @param options - Test compare options or annotation | ||
| */ | ||
| export async function toggled<T>({ test, run }: { |
There was a problem hiding this comment.
I'd suggest test.toggles (just like test.throws), because the test is actively running a callback, so you are asserting that the callback 'toggles' the tested value. Just like test.throws asserts that the callback will throw.
There was a problem hiding this comment.
I wasn't sure about toggled either, but followed waitToggled. I'm also worried it might imply we're waiting for off->on AND on->off transition. And I found in practice I need to be more concious about the test I'm writing (okay, first it needs to be false, the ntrue
also not sure if 'test' and 'run' should be in the same object, or just be two separate parametrs. Might be cleaner
Perhaps test.becomesTrue ?
waitToggled isn't used outside WH yet so we can still modify it to align with whatever changes made to toggled
There was a problem hiding this comment.
waitToggled reads more as 'wait until toggled', which would be more consistent with what the operation does (but it doesn't imply that the run() callback should trigger the toggle). test.becomesTrue has that last problem somewhat more. test.makesTrue? Don't like that one either, though.
There was a problem hiding this comment.
@copilot give us a couple of suggestions on how to name this api
There was a problem hiding this comment.
A couple of options that avoid implying a full on→off→on toggle:
test.transitionsToTrue({ test, run })/test.waitForTransitionToTrue({ test, run })— most explicit about the false→true condition.test.makesTrue({ test, run })/test.waitsForTrue({ test, run })— shorter and highlights the action, though slightly less precise.
I’d lean toward transitionsToTrue for clarity; becomesTrue is concise but doesn’t convey that the supplied run callback should cause it.
There was a problem hiding this comment.
@copilot make it test.transitionsToTrue({ test, run }) / test.waitForTransitionToTrue({ test, run }).
There was a problem hiding this comment.
Renamed the APIs and all repository call sites to transitionsToTrue / waitForTransitionToTrue. Committed as f630064.
Co-authored-by: unilynx <2772353+unilynx@users.noreply.github.com>
There was a problem hiding this comment.
🤖 Auto-Approved: PR author (@unilynx) is an internal organization/repository member.
delete() was untested and completely broken