ctdio/mocha-puppeteer

Consider allowing options to be configured using a .mocha-puppeteer-config file

Closed this issue · 4 comments

ctdio commented

This file would potentially work like a typical mocha.opts file, but would also allow for additional puppeteer options to be configured.

It may be useful to allow the config to be exported from a js file.

module.exports = {
  // options go here
}

gibs pls

ctdio commented

It's all yours @ctnordcl

So far, I have index.js using the fs module to check whether .mocha-puppeteer-config.js exists, and if it does, making an options object out of a call to require that file as a new module. From there, a destructuring of mochaOptions and puppeteerOptions is made from the required module, and then we can perform logic as needed on a set of options we want for both if them.

ctdio commented

As we discussed offline, I'll be taking this.