-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Remove test.cb()
#2387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Before it’s removed, it’s important that we have docs in place that show common |
Wish to include p-event similar internal, |
@ash0080 we'd rather people use |
With this commit, test.cb() has been removed. See #2387
With this commit, test.cb() has been removed. See #2387
With this commit, test.cb() has been removed. See #2387
With this commit, test.cb() has been removed. See #2387
With this commit, test.cb() has been removed. See #2387
With this commit, test.cb() has been removed. See #2387
I'm writing tests for a Pulumi application, and based on their own appears those require the callback approach. Here's a (TypeScript) sample macro I've written using the callback API: const hasTag: CbMacro<[AzureResource, string[]], PulumiContext> = (t, resource: AzureResource, expectedTags: string[]) => {
pulumi.all([resource.name, resource.urn, resource.tags])
.apply(([name, urn, tags]) => {
t.deepEqual(Object.getOwnPropertyNames(tags), expectedTags,
`Some required tags were missing from resource ${name} (${urn})`);
t.end();
});
} I'd like to move away from the callback model, but It's not immediately obvious to me how to promisify this: what are the resolve and reject scenarios? Annoyingly, while Pulumi's API is asynchronous, it is only Promise-like and doesn't actually return Promises anywhere; hence the |
@alastairs looks like |
@novemberborn That worked a treat, thank you so much 🙏 |
test.cb()
is a legacy API. It's probably time to remove it.Ideally we can define an experiment, say "noCb" so users can opt in to not having
test.cb()
available.When enabled, it should be removed from the chain:
https://github.com/avajs/ava/blob/56338dcb77246b5eca3c01e24d1cb6d66da8f71f/lib/create-chain.js#L77:L79
https://github.com/avajs/ava/blob/56338dcb77246b5eca3c01e24d1cb6d66da8f71f/lib/create-chain.js#L88:L92
Then by the time we're shipping the next breaking version we can remove it properly, from the TypeScript definition, the chain code and the implementation.
The text was updated successfully, but these errors were encountered: