This commit introduces tape as the test framework used to define the tests in the
test extension contexts and send them to the nodejs script that orchestrate the
test run.
The nodejs script has also been migrated from mocha to tape, it uses the custom test
helpers provided to setup the test environment (e.g. create a temporary dir
for the test extension, copy the last polyfill build, bundle tape to be used
in the test extension, start the browser which run the test extension
and finally collect the results of the test extension) and then it merges all the
tap logs collected from every test extension into a single "per browser" test suite.
- updated travis nodejs environment to nodejs 8
- uses tape to collect test results from inside the test extension
- added test case to check polyfill 'existing browser API object' detection
- added test for expected rejection on tabs.sendMessage with an invalid tabId
- added test with multiple listeners which resolves to undefined and null
- optionally run chrome smoketests with --enable-features=NativeCrxBindings
* Lock version of gruntify-eslint (and grunt-replace)
The current repository is compatible with gruntify-eslint 3.1.0.
`*` resolves to version 4.0.0., which bumps its eslint dependency
from 3.x to 4.x, which in turn causes linting errors.
To get the default check-out to pass, lock the dependencies to
known-compatible versions.
* Bump gruntify-eslint to 4.0.0 + fix lint error
Bump gruntify-eslint to 4.0.0, which depends on eslint ^4.0.0,
and fix the lint error that appeared.
This patch introduces on top of #17 some minor changes from the
review comments, in particular:
- do not replace require("../filename") to include the api-metadata.json
(restored the original '{/* include("...") */}' placeholder)
- raise an appropriate error message when the source file is used
by mistake (or the "dist/" file has not been built correctly).
- set the generated UMD wrapped module as the package.json main
entrypoint
- do not include api-metadata.json and src dir from the files included
in the published npm package
- run both build and test npm scripts on prepublish
This addresses [issue 7] by making it possible for users to run:
```sh
npm install webextension-polyfill
```
and download a module that they can use with a bundler as follows:
```js
import browser from 'webextension-polyfill';
```
Also, add a [prepublish script] so that users who clone the repo don't
need to run `grunt` manually. In addition, specify [files] in
package.json so that this module can be published to npm without
including miscellanea. This can be verified by running:
```sh
npm pack && tar -tvf webextension-polyfill-0.1.0.tgz
```
[issue 7]: https://github.com/mozilla/webextension-polyfill/issues/7
[files]: https://docs.npmjs.com/files/package.json#files
[prepublish script]: https://docs.npmjs.com/misc/scripts