donejs / donejs/generator-donejs

In package.json, testee should not use Firefox, but use puppeteer and headless chromium

Open
#267 2 comments 0 reactions 0 assignees View on GitHub
discussion enhancement
Dominant language
JavaScript
Stars
9
Forks
7
PR merge metrics
No merged PRs in 30d

Description

__Description:__
Currently the `test` task in package.json, looks like so:

`testee test.html --browsers firefox --reporter Spec`

Personally I think `donejs`, as meta-project, should be a kitchen-sink -- meaning, that we generate all you need to get up and running. I think this includes running tests from the command line. Currently, we also require them to have FF install, and we don't tell the User that its a pre-requisite.

I was one of those Users without FF installed.

I recommend the following change:

Add `"puppeteer": "^0.12.0"` to the `devDependencies` of `package.json`.
Change the `test` task to:

`testee test.html --config config/test.js --reporter Spec`

Add a `config` directory (this will be for all the applications configuration) at the top level and include a `test.js` file (thanks @nlundquist).

```js
const puppeteer = require('puppeteer');

// set chromium to node_modules local chromium supplied by puppeteer
process.env.LAUNCHPAD_CHROMIUM = `${puppeteer.executablePath()}`;

module.exports = {
browsers: [{ browser: 'chromium', args: ['--headless', '--disable-gpu', '--remote-debugging-port=9222'] }],
};
```

This also requires a version change of `testee` from `^0.3.0` to `^0.7.0` so that it can except JS files as configuration (and not just JSON files).

__Environment:__

| Software | Version
| -------------------------- | -------
| donejs -V | 1.0.1
| npm ls generator-donejs | 1.0.7

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.