Skip to content

Conversation

@sgrieve
Copy link
Owner

@sgrieve sgrieve commented Jun 9, 2019

It turns out that it is a pain to test chrome apps that only have a content.js script. We don't need to test browser interaction/ui stuff, so it is possible to just use a test framework to test the main logic of the code. I have chosen to use jest as it seems to fit my needs.

jest does not like the format of the content.js script and the workarounds I have found online rely on components that this extension does not need, such as background.js. So I have refactored the code, so all of the logic that I want to test is now included in standalone functions. These functions are moved automatically into a separate file, with the required node.js export commands to allow them to be tested independently of the extension itself.

This PR will track the progress of this, as well as the configuration of travis to run the tests automatically.

@sgrieve
Copy link
Owner Author

sgrieve commented Jun 9, 2019

Travis is running the tests fine, so now the remaining tasks for this PR are:

  • Write tests for all of the functions
  • Add some buttons to the readme
  • Properly complete package.json
  • Bump the version number
  • Update the readme with test instructions

@sgrieve
Copy link
Owner Author

sgrieve commented Jun 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants