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

What is the proper way of running tests? #77

Open
cwalther opened this issue Sep 23, 2019 · 1 comment
Open

What is the proper way of running tests? #77

cwalther opened this issue Sep 23, 2019 · 1 comment

Comments

@cwalther
Copy link
Contributor

I am confused as to how to run tests for Docson (and add tests for bugs I’m trying to fix, which is my actual motivation). Here is what I tried:

  • README.md refers to https://lbovet.github.io/docson/tests/test.html, however the current version of that file does not seem to work – it seems to have been left behind in the move of several things to public/. I can fix the paths, but then I discover that public/docson.js used by it seems to be outdated – it is not updated by npm run build, unlike the files in public/js. There however seems to be no usable replacement for it, I cannot find an output file that is both loadable in the browser (is not a CommonJS module, unlike lib/index.js) and exports the docson API without already using it (unlike public/js/webpage.js).
  • integration/README.md has some instructions. When I follow them (plus npm -g install nightwatch, which is not mentioned), I get the message Error: Cannot read test source location: /Users/cwalther/Documents/json-schema-tools/docson/nightwatch. I suspect this is a sign of bitrot too, since a folder nightwatch has existed once, before it was renamed to integration, and therefore stop searching in this direction.
  • I seem to have some success with node_modules/.bin/jest, which I try on a whim based on the presence of a jest.config.js. When run like that, it gets stuck with one test suite passing and the other still running (I think I have a fix for that and will follow up with a pull request), but when run individually (node_modules/.bin/jest integration/widget.test.js, node_modules/.bin/jest integration/basic.test.js), they pass. So it that the proper way?

Could any outdated things please be removed from the repository, or clearly marked as outdated?

If there is a supported automated way of running tests, I would also suggest naming it as scripts.test in package.json so that no detective work is required to find it.

@yanick
Copy link
Collaborator

yanick commented Sep 24, 2019

I have to dig back into my notes. I think that the tests were originally using Nightwatch, and I moved them to jest/puppeter. The part I don't remember is if all tests were already set to be running together, or if I always ran them one by one. I'll check back things, and get back to you -- prolly tomorrow.

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

No branches or pull requests

2 participants