Skip to content

[FSSDK-11100] JS - rewrite audience_avaluator tests in TypeScript #1001

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

Merged
merged 9 commits into from
Feb 13, 2025

Conversation

esrakartalOpt
Copy link
Contributor

Summary

Re-wrote the following test in typescript:

  • lib/core/audience_evaluator/index.tests.js
  • lib/core/audience_evaluator/odp_segment_condition_evaluator/index.tests.js

The old tests are written using (mocha + chai + sinon). Used vitest features in the new tests.

Test plan

Issues

  • FSSDK-11100

@esrakartalOpt esrakartalOpt marked this pull request as ready for review February 13, 2025 16:46
Copy link
Contributor

@junaed-optimizely junaed-optimizely left a comment

Choose a reason for hiding this comment

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

LGTM! Just one NIT


expect(result).toBe(false);

vi.restoreAllMocks();
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this redundant restore call.

Copy link
Contributor

@raju-opti raju-opti left a comment

Choose a reason for hiding this comment

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

LGTM

};

const audiencesById: {
[id: string]: Audience;
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: indentation

@esrakartalOpt esrakartalOpt merged commit 791ab90 into master Feb 13, 2025
11 of 15 checks passed
@esrakartalOpt esrakartalOpt deleted the esra/FSSDK-11100_audience_evaluator_test branch February 13, 2025 20:42
@coveralls
Copy link

coveralls commented Feb 13, 2025

Coverage Status

coverage: 82.08%. remained the same
when pulling 1761d4a on esra/FSSDK-11100_audience_evaluator_test
into 506d441 on master.

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.

4 participants