Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nolanlawson
Copy link
Contributor

This removes an annoying error message in the test (which is totally expected) and also improves the tests for apex methods returning a promise.

it('exports refreshApex method returning a promise', () => {
expect(refreshApex()).resolves.toEqual(undefined);
expect(refreshApex()).not.toBeUndefined();
expect(refreshApex().then).toEqual(expect.any(Function)); // should be a thenable (promise)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why a thenable rather than instance of Promise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Old habit? I guess my mind is still stuck in the days when Promises weren't supported everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed: e083fa4

@nolanlawson nolanlawson merged commit 0481a18 into master Jul 1, 2024
@nolanlawson nolanlawson deleted the nolan/cleanup branch July 1, 2024 23:23
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