-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Headless Chrome / Puppeteer #63
Comments
Should be doable, only needs to adapt the way messages are sent back from the browser to the template. Also needs to check for possible changes how templates operate in jasmine v2.0 https://github.com/gruntjs/grunt-contrib-jasmine/wiki/Jasmine-Templates |
So as far as I can tell, The way they bind messages is by just calling global functions bound to the window PuppeteerReporter.js const sendMessage = (type, param) => {
window[type] && window[type](param);
};
const reporter = {
jasmineStarted: function() {
sendMessage('jasmine.jasmineStarted');
}
// ... Omitted
} and then binding to those functions when the page is set up jasmine.js await page.exposeFunction('jasmine.jasmineStarted', function() {
// ... Omitted
}); However, the template stuff happens before that in The way I see how this could work somewhat neatly under the new framework would be something where they expose an additional listener that they also bind to, like As it is structured right now, I don't see a clear way to get the |
Right, there is no page or anything in the task (https://github.com/gruntjs/grunt-contrib-jasmine/blob/a71cc54b6c60d275799436d02989167cf50ca1c0/tasks/lib/jasmine.js#L129). |
Wouldn't The handlers for all the standard events in the reporter just print stuff out (they don't really allow for hooks...) and the scripts in the page can't write anything to disk (including I think ideally we would want |
If this has no side effects, I think modifying how the jasmine plugin works seems normal. It might allow other integrations as well. Our failure to expose the page was not intentional, merely a regression of not fully understanding the scope of grunt-contrib-jasmine's ecosystem. |
Is there a solution or a workaround for this problem? Or how did you guys resolve the coverage of your code? |
The current solution, unfortunately, is to use an older version of I never got around to actually making a patch for both projects to make things work harmoniously but maybe one of these days... A more "future proof" solution may be to move to whatever new build and CI system that's popular these days. I have a hunch that not many people are interested in running jasmine+istanbul on grunt anymore... |
Hi, |
grunt-contrib-jasmine moved to headless chrome in v2.0 but this template seems to assume phantomjs which breaks when compiling the spec runner.
Any way this could be updated to work on headless chrome? (and work with the new grunt-contrib-jasmine)
The text was updated successfully, but these errors were encountered: