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

Look into using Chai for testing the code #22

Open
au-shah opened this issue May 21, 2020 · 5 comments
Open

Look into using Chai for testing the code #22

au-shah opened this issue May 21, 2020 · 5 comments
Assignees
Labels

Comments

@au-shah
Copy link
Collaborator

au-shah commented May 21, 2020

Use Chai for unit tests

@au-shah au-shah added the test label May 21, 2020
@Heverett94 Heverett94 self-assigned this Jun 20, 2020
@Heverett94
Copy link
Collaborator

Heverett94 commented Jun 20, 2020

To set up tests I have created an index.js to handle exported classes and have set up the frame work to get tests running via chai/mocha.

However due to the use of JQuery I've had to import and require npm modules for it (JQuery and jsdom) to allow $ and document to work, doing this has caused a number of problems due to dependencies. And to get jquery working console side it requires bash and darwin, as I'm currently working on windows this is causing quite a problem, and will require me to use a mac.

I'm currently looking for a work around on this, as we wont have our macs forever.
Current lead is : https://www.npmjs.com/package/browserify as the issue is jquery requires a DOM, when running it via cli that doesn't exist hence document is undefined

Will report back

@Heverett94
Copy link
Collaborator

Riggghhht! So turns out we needed an extra module: puppeteer, this will also allow you to emulate pressing buttons and stuff.

In 5b0099c i've added all the modules needed to get tests started. Currently we only have one test but the hard part is over.

@Heverett94
Copy link
Collaborator

To run the tests you need to npm start then run the tests.

@Heverett94
Copy link
Collaborator

With this method you can check url's and stuff as it puppets a chromium instance.

@Heverett94
Copy link
Collaborator

Also while running tests sometimes theres a timeout error, only way to get around it is run the tests again -shrug-

@dambem dambem added this to the Festival Of The Mind Deadline milestone Jun 23, 2020
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

3 participants