-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: allow open option to accept an object #2492
Changes from 2 commits
82734a2
f7fc490
bc68f10
d669b69
eaf15d2
a69a9e3
f5a0129
5c8eac3
f1eef86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,5 +255,31 @@ describe('runOpen util', () => { | |
`); | ||
}); | ||
}); | ||
|
||
it('on specify URL with page in Google Chrome incognito mode and log error ', () => { | ||
return runOpen( | ||
'https://example.com', | ||
{ | ||
open: { app: ['Google Chrome', '--incognito'] }, | ||
openPage: '/index.html', | ||
}, | ||
logMock | ||
).then(() => { | ||
expect(logMock.warn.mock.calls[0][0]).toMatchInlineSnapshot( | ||
`"Unable to open \\"https://example.com/index.html\\" in browser: \\"{\\"app\\":[\\"Google Chrome\\",\\"--incognito\\"]}\\". If you are running in a headless environment, please do not use the --open flag"` | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need better test 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the best way to test it is manually because even if I found a way to test chrome the chrome start name is different in operating systems ex :
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can use other flag, not good idea keep errors in tests in that case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @evilebottnawi what about replacing it with: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea 👍 |
||
expect(opn.mock.calls[0]).toMatchInlineSnapshot(` | ||
Array [ | ||
"https://example.com/index.html", | ||
Object { | ||
"app": Array [ | ||
"Google Chrome", | ||
"--incognito", | ||
], | ||
}, | ||
] | ||
`); | ||
}); | ||
}); | ||
}); | ||
}); |
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.