Skip to content

Commit

Permalink
- Docs: Update testing info (using puppeteer now over PhantomJS); ins…
Browse files Browse the repository at this point in the history
…tructions on web-platform-tests

- Testing (Grunt): Fix non-Sauce QUnit task to point to puppeteer
- Testing (Grunt): Add build and connect routine to puppeteer testing
  • Loading branch information
brettz9 committed Jun 1, 2018
1 parent af82f8f commit d9e824a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ module.exports = function (grunt) {

const testJobs = ['build', 'connect'];
grunt.registerTask('nodequnit', 'node-qunit');
grunt.registerTask('puppeteer-qunit', 'qunit_puppeteer');
grunt.registerTask('puppeteer-qunit', [...testJobs, 'qunit_puppeteer']);
grunt.registerTask('mocha', ['mochaTest:test']); // clean:mochaTests isn't working here as locked (even with force:true on it or grunt-wait) so we do in package.json
grunt.registerTask('fake', ['mochaTest:fake']);
grunt.registerTask('mock', ['mochaTest:mock']);
Expand All @@ -444,7 +444,7 @@ module.exports = function (grunt) {
if (saucekey !== null) {
testJobs.push('saucelabs-qunit');
} else {
testJobs.push('qunit');
testJobs.push('puppeteer-qunit');
}

grunt.registerTask('sauce-qunit', testJobs);
Expand Down
16 changes: 6 additions & 10 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@ a [problem in Firefox](https://github.com/axemclion/IndexedDBShim/issues/250).
#### Automated browser unit testing

Follow all of the steps above to build the project, then run `npm test`
or `npm run sauce-qunit` (or `npm run phantom-qunit` or
`grunt phantom-qunit` to avoid using Saucelabs when you have
or `npm run sauce-qunit` (or `npm run puppeteer-qunit` or
`grunt puppeteer-qunit` to avoid using Saucelabs when you have
credentials set up as environmental variables) to run the unit tests.

Note that when not running Saucelabs, the tests are run in
[PhantomJS](http://phantomjs.org/), which is a headless WebKit browser.

The older PhantomJS version has problems with two tests, however:
`index.openCursor(range)` and
`IDBObjectStore.openKeyCursor` due apparently to
a bug with the WebKit browser used in the older PhantomJS implementation
(but the tests themselves report as having such problems).
[grunt-qunit-puppeteer](https://github.com/timostark/qunit-puppeteer),
which uses headless Chromium.

Although it is possible to get the W3C `web-platform-tests` runner
working via patches as per
Expand Down Expand Up @@ -92,7 +87,8 @@ To run the Node tests, run the following:
3. `npm run tests-polyfill` (or its components `npm run fake`,
`npm run mock`, `npm run w3c-old`). Note that only `fake` is
currently passing in full, however.
4. `npm run w3c` (you must first run
4. `npm run web-platform-tests` and in a separate terminal window,
`npm run w3c` (you must first run
`git submodule update --init --recursive` (possibly without
[init](http://stackoverflow.com/a/10168693/271577) too if using
an older version of Git), `git submodule foreach --recursive git fetch`,
Expand Down

0 comments on commit d9e824a

Please sign in to comment.