How do I resolve duplicate Test IDs when using Mocha?
Duplicate Test IDs can occur when running the check-tests script with Mocha, especially if multiple tests in a file lack existing Testomatio IDs.
- Identify Duplicate IDs: Run the script
npx check-tests mocha 'src/specs/**/*.tests.ts' --typescript --update-idsand check for any import errors indicating duplicate IDs. - Manually Remove Duplicate IDs: Open the test files and manually search for the duplicate IDs. Remove the IDs from both tests that have the same ID.
- Rerun the Script: After removing the duplicate IDs, rerun the script to generate new, unique Testomatio IDs for the tests.
- If you have made changes to the check-tests script to address this issue, consider testing them thoroughly before submitting a pull request.