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
feat(Dev): Allow development under Windows platform #992
feat(Dev): Allow development under Windows platform #992
Conversation
@@ -9,13 +9,13 @@ | |||
}, | |||
"scripts": { | |||
"unit": "jasmine test/test.js", | |||
"debug-unit": "DEBUG_TEST=true node --inspect-brk ./node_modules/.bin/jasmine test/test.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, why changing .bin/jasmine
to jasmine/bin/jasmine.js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had an exception:
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
This is where I found the solution https://github.com/gotwarlost/istanbul#usage-on-windows
test/test.js
Outdated
@@ -102,7 +103,8 @@ describe('Puppeteer', function() { | |||
await neverResolves; | |||
expect(error.message).toContain('Protocol error'); | |||
})); | |||
it('userDataDir option', SX(async function() { | |||
// Windows has issues running Chromium using a custom user data dir. It hangs when closing the browser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the #918
Could you please refer to the issue in the comment so that we keep track of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
test/test.js
Outdated
@@ -111,7 +113,7 @@ describe('Puppeteer', function() { | |||
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0); | |||
rm(userDataDir); | |||
})); | |||
it('userDataDir argument', SX(async function() { | |||
(windows ? xit : it)('userDataDir argument', SX(async function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's refer to #918 here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, these are good changes. I wonder though why @JoelEinbinder didn't experience any of these during his time on Windows machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I hit these problems but was just living with the pain.
This patch improves life of puppeteer contributor on Windows: - Setting environment variables using cross-env since Windows requires the SET command. - Calling Jasmine in the script debug-unit using jasmine's JavaScript binary instead of shell. - Add /test/test-user-data-dir* to .gitignore since temporary user data directories, in case of test fails, remains in the test directory.
Allow development under Windows platform:
Problems resolved
cross-env
since Windows requires the SET command.debug-unit
using jasmine's JavaScript binary instead of shell./test/test-user-data-dir*
to .gitignore since temporary user data directories, in case of test fails, remains in the test directory.Problems which didn't resolve
Output: