Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up and prove testing framework (Jest and Puppeteer?) #79

Open
11 tasks
akc42 opened this issue Sep 24, 2020 · 2 comments
Open
11 tasks

Set up and prove testing framework (Jest and Puppeteer?) #79

akc42 opened this issue Sep 24, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@akc42
Copy link
Owner

akc42 commented Sep 24, 2020

I want to start a proper testing regime - might not set up tests for everything immediately, but at least anytime there is a bug I want to make sure I can set up a test which fails before the bug is fixed and doesn't when I have fixed it

  • Try cypress and see if it can replace puppeteer and/or jest (possibly jest for server side?)
  • Set up Jest testing environment
  • Set up Puppeteer testing environment
  • Figure out how to mock Ajax requests (is it in Jest or will I need Sinon?)
  • Figure out how to mock HTTP so I can test server.js
  • Figure out how to structure tests so I can have a test database initialised by database.sql
  • Write some initial tests for server.js - particularly Initial Database Setup
  • Write a test for /api/pin in server.js
  • Write test that checks api token for all "logged in" requests
  • Write a test that checks cid is checked for in Admin and User Apis
  • Write at least one client side test
@akc42 akc42 added the testing label Sep 24, 2020
@akc42 akc42 added this to the v4.0.0 milestone Sep 24, 2020
@akc42 akc42 self-assigned this Sep 24, 2020
@akc42
Copy link
Owner Author

akc42 commented Sep 29, 2020

IF I use jest there are three separate test scenarios that require different approaches.

  1. Server module testing - jest on its own
  2. Client module testing - jest and jest-electron (An app written in electron for testing)
    3 End to end testing - jest and puppeteer.

Note there is a jest-puppeteer but it takes over jest and I am thinking I only needed it for one third of my potential testing regime, so is it appropriate?

@akc42
Copy link
Owner Author

akc42 commented Sep 29, 2020

I have also been looking at Cypress, which is able to do client and end to end testing on one package and has lots of nice features to see how tests fail. I think this is actually my first job
IF I do this server tests can use existing mocha, chai, (sinon?) setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant