Closed ijkilchenko closed 8 years ago
I might to be able to help out here. Have a look at https://github.com/hschroedl/tiss-plus-plus I used Karma (as test runner), mocha (testing framework) and sinon/sinon-chrome (for mocking chrome methods). Will try to get a pull request together till the end of the week.
@hschroedl That would be amazing! I've been having a really hard time getting started with mocking and testing in JavaScript. :D
Right now there is no automated tests that can be run, unfortunately. I am not sure how best to perform testing of a Chrome extension (or a JavaScript project in general since I am not yet familiar with JavaScript).
One thing that I would like to do is set up some JavaScript files which can be run with NodeJS. I could refactor some of the methods that I use in
content_script.js
into a library and then test those methods separately from various Chrome extension specific methods/variables.Another thing that I would like to explore is mocking Chrome methods/variables using some sort of a library like https://github.com/acvetkov/sinon-chrome but the usefulness of this is unclear at this point. Any suggestions are welcomed.