@mands/nx-playwright
Advanced tools
Comparing version 0.1.13 to 0.1.14
{ | ||
"name": "@mands/nx-playwright", | ||
"version": "0.1.13", | ||
"version": "0.1.14", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -14,3 +14,12 @@ "use strict"; | ||
const timeoutOption = options.timeout !== undefined ? `--timeout=${options.timeout}` : ''; | ||
const flagStrings = [headedOption, browserOption, reporterOption, timeoutOption].filter(Boolean); | ||
const grepOption = options.grep !== undefined ? `--grep=${options.grep}` : ''; | ||
const grepInvertOption = options.grepInvert !== undefined ? `--grep-invert=${options.grepInvert}` : ''; | ||
const flagStrings = [ | ||
headedOption, | ||
browserOption, | ||
reporterOption, | ||
timeoutOption, | ||
grepOption, | ||
grepInvertOption, | ||
].filter(Boolean); | ||
return flagStrings.join(' '); | ||
@@ -17,0 +26,0 @@ } |
@@ -47,2 +47,3 @@ import utilModule from 'util'; | ||
timeout: 1234, | ||
grep: '@tag1', | ||
}; | ||
@@ -56,5 +57,21 @@ | ||
const expected = | ||
'yarn playwright test src --config folder/playwright.config.ts --headed --browser=firefox --reporter=html --timeout=1234'; | ||
'yarn playwright test src --config folder/playwright.config.ts --headed --browser=firefox --reporter=html --timeout=1234 --grep=@tag1'; | ||
expect(execCmd).toHaveBeenCalledWith(expected); | ||
}); | ||
it('concatenates overriding options to playwright command with grep-invert', async () => { | ||
const options: PlaywrightExecutorSchema = { | ||
e2eFolder: 'folder', | ||
grepInvert: '@tag1', | ||
}; | ||
const execCmd = jest.fn().mockResolvedValueOnce({ stdout: 'passed', stderr: '' }); | ||
promisify.mockReturnValueOnce(execCmd); | ||
await executor(options, context); | ||
const expected = | ||
'yarn playwright test src --config folder/playwright.config.ts --grep-invert=@tag1'; | ||
expect(execCmd).toHaveBeenCalledWith(expected); | ||
}); | ||
}); | ||
@@ -61,0 +78,0 @@ |
@@ -15,2 +15,4 @@ import type { PackageRunner } from '../../types'; | ||
skipServe?: boolean; | ||
grep?: string; | ||
grepInvert?: string; | ||
} |
Sorry, the diff of this file is not supported yet
45446
842