Skip to content

Conversation

dynst
Copy link
Contributor

@dynst dynst commented Aug 18, 2025

The fail() and pending() globals exist in no other testing suite and are completely non-portable idioms.

There's good reason others didn't copy them, dynamically deciding whether or not to skip every individual test only after each one has already started executing is a bit...barbaric.

@dynst dynst force-pushed the jasmine-removal-prep branch from c3383b8 to 286373f Compare August 18, 2025 16:41
@dynst dynst force-pushed the jasmine-removal-prep branch 3 times, most recently from 422bb8e to b15a071 Compare August 19, 2025 01:33
@dynst dynst force-pushed the jasmine-removal-prep branch from 6e34a71 to b7efa10 Compare August 30, 2025 21:54
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Looks very nice

return;
}
}
const enabled = !!(globalThis.process?.env.SIMAPP47_ENABLED || globalThis.process?.env.SIMAPP50_ENABLED);
Copy link
Member

Choose a reason for hiding this comment

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

Can we use this simappEnabled() like below for consistency and readability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is faucet, that function only exists in the test-only code of a completely separate package.

const ret = new Promise<void>((resolve, reject) => {
done = resolve as typeof done;
done.fail = reject;
});
Copy link
Member

Choose a reason for hiding this comment

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

This looks great. Could we deduplicate the typeof done for all of the tests? And what about calling this via done.success()/done.fail() to avoid done being a function and an object at the same time? This way we could also avoid the casts from typeof resolve to typeof done.

Copy link
Contributor Author

@dynst dynst Oct 8, 2025

Choose a reason for hiding this comment

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

No code calls done.success() (which doesn't exist in Jasmine or isn't documented?), lots of code calls done(), so this was all just written as a purely mechanical change with an absolute minimum of code changes.

It doesn't really seem possible to share testing-only code across packages... or seem worth it to add a way to do it. So any potential deduplicating would be very limited. Maybe a followup PR?

@webmaster128 webmaster128 added this to the 0.37 milestone Oct 7, 2025
@webmaster128
Copy link
Member

Thanks!

@webmaster128 webmaster128 merged commit 1cbcb29 into cosmos:main Oct 8, 2025
13 checks passed
webmaster128 added a commit that referenced this pull request Oct 8, 2025
webmaster128 added a commit that referenced this pull request Oct 8, 2025
webmaster128 added a commit that referenced this pull request Oct 8, 2025
webmaster128 added a commit that referenced this pull request Oct 8, 2025
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.

2 participants