Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('uses custom output dir and url', async () => {
const { url } = await runSpectron(
{},
{
url: 'http://localhost:1234/',
outputDir: 'customOutput'
}
)
// Proper URL is returned
expect(url).toBe('http://localhost:1234/')
const appArgs = Application.mock.calls[0][0]
// Spectron is launched with proper path to output dir
expect(appArgs.args).toEqual(['customOutput'])
})
test('uses custom spectron options if provided', async () => {
await runSpectron({ spectronOptions: { testKey: 'expected' } })
// Custom spectron option is passed through
expect(Application.mock.calls[0][0].testKey).toBe('expected')
})