salesforce / lightning-labs

MIT License
3 stars 4 forks source link

Mocks in one test file should not effect mocks in another test file #4

Closed divmain closed 1 month ago

divmain commented 1 month ago

When running multiple test suites in parallel, the exports must currently be identical for all mocked-module declarations. E.g. you cannot have import mockFoo from 'mock{all,the,things}:foo'; in one test file and import mockFoo from 'mock{other,things}:foo'; in another test file.

Due to Web Test Runner's underlying architecture, each it test runs in isolation. However, some state related to the mocking is present in the host Node process. The implementation should be updated to ensure that one test file's mocks cannot impact another test file's mocks.