Closed nicolas377 closed 2 years ago
We could use sinon with a fake (like this one). We might have to setup the window.chrome object as the fake everything uses. We also might need to use sinon fakes or spies for that as well. This would be something we do after we integrate to a monorepo. (#81) Scripts and the overarching chrome extension could have their own local unit tests run from their build folders.
This issue will be idle until #81 is done, and then we'll start working on unit tests.
We're actually going to try to grind out 3.3.0, and then we'll PR in infrastructure for unit tests, along with some basic tests for the extension. Gradually, we can add unit tests for scripts, so this will be a more long-term improvement.
ts-sinon along with sinon-chrome should do the trick with regards to testing.
Is your feature request related to a problem? If so, please explain. There's not really a good way to test PRs besides manual review, which isn't really good.
What would you like added? Comprehensive tests that run on the tests.yml action and can be accessed by a npm test script.
Check out this test by Mobile First for "inspiration" wink wink