Skip to content
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

[SDKS-7563] Stabilize integration tests #762

Merged
merged 3 commits into from
Oct 2, 2023
Merged

[SDKS-7563] Stabilize integration tests #762

merged 3 commits into from
Oct 2, 2023

Conversation

emmaz90
Copy link
Contributor

@emmaz90 emmaz90 commented Sep 28, 2023

JS SDK

What did you accomplish?

Stabilize Integration tests for flag sets implementation

How do we test the changes introduced in this PR?

Extra Notes

@emmaz90 emmaz90 requested a review from a team as a code owner September 28, 2023 20:02
@@ -503,10 +503,6 @@ export default function (fetchMock, assert) {
const client = splitio.client();
const manager = splitio.manager();

client.once(client.Event.SDK_READY_FROM_CACHE, () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than simply removing asserts, it is better to update them to keep information of the expected behaviour:

client.once(client.Event.SDK_READY_FROM_CACHE, () => {
  t.fail('It should not emit SDK_READY_FROM_CACHE because ...');
  t.end();
});

Idem for the other removed asserts.

Copy link
Contributor

@EmilianoSanchez EmilianoSanchez Sep 28, 2023

Choose a reason for hiding this comment

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

With this change, none of the tests below line 472 (/** Fetch specific splits **/) is asserting that the SDK_READY_FROM_CACHE event is emitted when using split filters.

So, I would create a new test for the following basic case:

  assert.test(t => { // Testing when we start with cached data with split filter, and the same split filter is provided in the config

This should emit the event because the config has the same split filter as the one in the cache.

@emmaz90 emmaz90 merged commit 079e733 into sdks-7437 Oct 2, 2023
3 checks passed
@emmaz90 emmaz90 deleted the sdks-7563 branch October 2, 2023 20:07
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