ijkilchenko / Fuzbal

Chrome extension: Gives Ctrl+F like find results which include non-exact (fuzzy) matches using string edit-distance and GloVe/Word2Vec. Also searches by regular expressions.
https://chrome.google.com/webstore/detail/fuzbal/lidjpicdkcgjdkgifmmpalkibjeppdof
MIT License
135 stars 11 forks source link

Suggestions for unit testing and integration testing #19

Closed ijkilchenko closed 8 years ago

ijkilchenko commented 8 years ago

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.

hschne commented 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.

ijkilchenko commented 8 years ago

@hschroedl That would be amazing! I've been having a really hard time getting started with mocking and testing in JavaScript. :D