es-toolkit
es-toolkit copied to clipboard
🚚 Move test cases from `lodash` and validate `es-toolkit/compat`
What is es-toolkit/compat?
es-toolkit/compat
is a compatibility layer designed to help you transition from lodash
to es-toolkit
. It aims for 100% compatibility with lodash.
See our compatibility docs.
Moving test cases from lodash
We need your help to move test cases from lodash to es-toolkit. Here's how you can contribute:
- Find a function in the "in review" stage in our compatibility docs.
-
Migrate the corresponding test code from lodash.
- Place the test code in our compat directory.
- Adjust the code as needed, e.g., change
lodashStable.map(arr, fn)
toarr.map(fn)
. - For which test cases to move, please refer to our design principles.
- Example: The test code for drop.
- Run the migrated test code with
vitest ./src/compat/**/*
. - Fix any failing test cases.
- Add compatibility implementations if needed.
- Example: chunk.
- If all tests pass, update our compatibility docs.