Skip to content

Feature/consilio fix delete - #53

Merged
blexrob merged 4 commits into
mainfrom
feature/consilio-fix-delete
Oct 13, 2026
Merged

blexrob merged 4 commits into
mainfrom
feature/consilio-fix-delete

Conversation

@unilynx

@unilynx unilynx commented Oct 12, 2026

Copy link
Copy Markdown
Member

delete() was untested and completely broken

@unilynx
unilynx requested a review from a team October 12, 2026 08:30
webharebot[bot]
webharebot Bot previously approved these changes Oct 12, 2026

@webharebot webharebot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-Approved: PR author (@unilynx) is an internal organization/repository member.

Comment thread whtree/jssdk/test/src/checks.ts Outdated
* @param toggle.run - The function to run
* @param options - Test compare options or annotation
*/
export async function toggled<T>({ test, run }: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot give us a couple of suggestions on how to name this api

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot make it test.transitionsToTrue({ test, run }) / test.waitForTransitionToTrue({ test, run }).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the APIs and all repository call sites to transitionsToTrue / waitForTransitionToTrue. Committed as f630064.

Co-authored-by: unilynx <2772353+unilynx@users.noreply.github.com>

@webharebot webharebot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-Approved: PR author (@unilynx) is an internal organization/repository member.

@blexrob
blexrob merged commit ccd704d into main Oct 13, 2026
60 of 63 checks passed
@blexrob
blexrob deleted the feature/consilio-fix-delete branch October 13, 2026 12:26
blexrob added a commit that referenced this pull request Oct 14, 2026
#53 and #47 were merged at the same time but not compatible. this PR
fixes that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants