Skip to content

Junaed/fssdk 11034 tests js to ts #1000

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 14 commits into from
Feb 7, 2025

Conversation

junaed-optimizely
Copy link
Contributor

@junaed-optimizely junaed-optimizely commented Feb 6, 2025

Summary

Test conversions from JS (Mocha, Chai, Sinon) to TS (Vitest).

Test plan

  • TS test addition

Issues

@coveralls
Copy link

coveralls commented Feb 6, 2025

Coverage Status

coverage: 82.08%. remained the same
when pulling ef5ab3b on junaed/fssdk-11034-tests-js-to-ts
into 21522ca on master.

@@ -1,916 +0,0 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

please keep the old files for now. We will remove them later

import { describe, it, expect, beforeEach, afterEach, vi, assert, Mock } from 'vitest';
import { forEach, cloneDeep } from 'lodash';
import { sprintf } from '../utils/fns';
import fns from '../utils/fns';
Copy link
Contributor

Choose a reason for hiding this comment

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

we should get rid of the default export and only used named exports (for better tree-shaking. Please use named exports, and later we will remove the default export when every default import is re written

@@ -1,974 +0,0 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

please keep the old tests for now

package.json Outdated
@@ -119,6 +119,7 @@
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/chai": "^4.2.11",
"@types/lodash": "^4.17.15",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should just get rid of lodash at some point. forEach import from lodash is not needed, and for cloneDeep we can use JSON stringify and parse. We can remove loadsh when every usage of it is removed

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

@junaed-optimizely junaed-optimizely merged commit 506d441 into master Feb 7, 2025
17 of 21 checks passed
@junaed-optimizely junaed-optimizely deleted the junaed/fssdk-11034-tests-js-to-ts branch February 7, 2025 17:32
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