Comments (6)
Mochify is structured relatively modular now. I’m developing towards the goal of having every feature being a thing that is added to the Browserify pipeline. Eventually projects like min-wd and consolify should be plugins that can be optionally installed. The Firefox integration could also be a plugin. I’m dreaming of creating an org for these projects.
In reality, I don’t have the time to realize this. I’m glad to assist and review if you want to help :)
from mochify.js.
So puppeteer/puppeteer#3652 got closed and it seems that it should now be possible to run tests against Firefox too (I also think ™️ I just got a test passing on my machine using Firefox following the instructions here: https://github.com/puppeteer/puppeteer/blob/v5.2.1/docs/api.md#puppeteerlaunchoptions).
The nice thing is that this can be achieved by passing a product
parameter (i.e. mochify wouldn't need to introduce an extra dependency but only learn about a new option).
Parts that worry me about it though are:
- The puppeteer version mochify is using is 4 major versions behind, will this require major changes?
- There are lots of things in mochify that refer to
chromium
, should all of this be renamed if we'd add Firefox support? - Installing Firefox for puppeteer seems brittle right now. Is this something we'd leave up to users or try to have mochify do for them?
from mochify.js.
I looked into this a little further.
Upgrading to Puppeteer 5 seems to work with two caveats:
- we'd have to drop Node 6 and 8
- Puppeteer now uses the
fs.promises
API which means Node 10 will log a lot of warnings about its usage. Tests will need to be run withNODE_NO_WARNINGS=1
to silence this
As for running the tests in Firefox, this seems to work mostly, but sometimes Firefox will log unexpected things in addition, sometimes it times out and other times tests fail for reasons I don't understand. It also seems to be pretty slow. I'll look into it further when I find the time to do so.
from mochify.js.
Thank you for investigating. I'm currently too busy with other things. It would be great to support Firefox. But if it's too brittle, it can wait, I think. I'm not too keen having issues in Mochify that arn't related to the project itself.
My thoughts on your points:
- Dropping older node versions with a new major release is fine. They're end of life. Especially if we're upgrading puppeteer majors anyway.
- If puppeteer doesn't run without warnings in node 10 anymore, we should probably drop support for that version too.
- Things that refer to
chromium
could be renamed topuppeteer
. Should we introduce an additional argument which engine to use?
from mochify.js.
But if it's too brittle, it can wait, I think.
I totally share that sentiment. I can keep an eye on how the Firefox integration in Puppeteer evolves and whenever it seems to be mature enough, we can pull it into Mochify. It'd be especially important that you can install both Chromium and Firefox side by side without jumping through too many hoops (right now it's a lot of hoops still).
Should we introduce an additional argument which engine to use?
--engine
with a default of chromium
sounds fab.
from mochify.js.
I just looked into this again and it seems the issue we are seeing with Firefox <-> Puppeteer has not been resolved yet.
Looking for alternatives I tried swapping out Puppeteer with Playwright and this seems to bring us much closer to supporting Firefox. The APIs of the two libraries are mostly identical (18d9123#diff-8aa031d8dc1e01f5f5af954cda92a1e567897406df81a442fb1a494cdb9f3648) and most tests already pass when using Firefox (albeit it's much slower than chromium). There are some Chromium specific things (e.g. --web-security
flag) Mochify would need to figure out still, but probably nothing too major.
Since you've been talking about a revamped Mochify @mantoni recently I am not sure however if the effort is worth it (especially considering this will likely bring some breaking changes for consumers in some cases). I'd be happy to spend some time looking into this further in the next few weeks, but I also don't have to.
from mochify.js.
Related Issues (20)
- Async test cases that fail end the entire test suite HOT 2
- Mochify does not work on Browserstack with Safari 12 or Firefox 64 HOT 10
- uncaught errors should be printed to stderr, not stdout HOT 6
- Support `--dumpio` option for tracing down errors with chromium
- Pass flags to Browserify HOT 3
- Update to a more recent version of mocha HOT 9
- Use Browserify 17 HOT 1
- Mochify Rewrite HOT 14
- `window._webdriver_manualPoll is not a function` on BrowserStack since 8.0.0 HOT 1
- Rewrite: Puppeteer settings HOT 1
- Rewrite: Integration tests for WebDriver
- Rewrite: Implement watch mode HOT 7
- Rewrite: Allow "external" mochify drivers
- Rewrite: Support native JavaScript modules HOT 2
- Rewrite: Release & publishing strategy HOT 11
- Rewrite: v1.0.0
- Rewrite: nested configuration does not get merged correctly
- Rewrite: Documentation HOT 1
- Rewrite: read spec/bundle from stdin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mochify.js.