Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await runCommand('electron:serve', {}, {}, [...args, '--keep2'])
// Custom args should have been removed, and other args kept
calledArgs = execa.mock.calls[0][1]
// Remove dist_electron
calledArgs.shift()
expect(calledArgs).toEqual(['--keep2'])
execa.mockClear()
await runCommand('electron:serve', {}, {}, ['--keep1', ...args])
// Custom args should have been removed, and other args kept
calledArgs = execa.mock.calls[0][1]
// Remove dist_electron
calledArgs.shift()
expect(calledArgs).toEqual(['--keep1'])
execa.mockClear()
await runCommand('electron:serve', {}, {}, args)
// Custom args should have been removed
calledArgs = execa.mock.calls[0][1]
// Remove dist_electron
calledArgs.shift()
expect(calledArgs).toEqual([])
execa.mockClear()
await runCommand('electron:serve', {}, {}, ['--keep1', '--keep2'])
// Nothing should be removed
calledArgs = execa.mock.calls[0][1]
// Remove dist_electron
calledArgs.shift()
expect(calledArgs).toEqual(['--keep1', '--keep2'])
execa.mockClear()
afterEach(() => {
restoreEnv()
execa.mockClear()
readJSON.mockClear()
})
beforeEach(() => {
execa.mockClear()
})
beforeEach(() => {
resolveGitDir.mockClear()
mockFn.mockClear()
})
afterEach(() => {
mockFn.mockClear()
})
beforeEach(() => {
execa.mockClear()
})
afterEach(() => {
execa.mockClear()
pMap.mockClear()
})