Open cwalther opened 4 years ago
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.
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:
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 thedocson
API without already using it (unlike public/js/webpage.js).npm -g install nightwatch
, which is not mentioned), I get the messageError: 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.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.