-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add concurrently & wait-on command (#34)
* refactor(install cmd): extract logic into their own functions * refactor: ask for testFiles config in cucumber step & collect all paths * feat: use concurrently and wait-on to start both app and cypress * refactor(open & run cmd): extract shared code into tools modules * fix(cypress config): spread object instead of array into object
- Loading branch information
Showing
16 changed files
with
451 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const appStart = { | ||
describe: 'Command to start app (disabled with empty string)', | ||
type: 'string', | ||
default: 'yarn start', | ||
} | ||
|
||
const waitOn = { | ||
describe: 'Url to wait for before running cypress', | ||
type: 'string', | ||
default: 'http-get://localhost:3000', | ||
} | ||
|
||
module.exports = { | ||
appStart, | ||
waitOn, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const inquirer = require('inquirer') | ||
const { addToJson } = require('../../utils/fs.js') | ||
const { copy } = require('../../utils/fs.js') | ||
const { | ||
CYPRESS_CONFIG_PATH, | ||
CUCUMBER_PLUGIN_TEMPLATE_SOURCE, | ||
CUCUMBER_PLUGIN_TEMPLATE_DESTINATION, | ||
CUCUMBER_CONFIG_TEMPLATE_SOURCE, | ||
CUCUMBER_CONFIG_TEMPLATE_DESTINATION, | ||
} = require('../../utils/paths.js') | ||
|
||
const createCucumberConfigs = async force => { | ||
const prompt = inquirer.createPromptModule() | ||
|
||
copy( | ||
CUCUMBER_PLUGIN_TEMPLATE_SOURCE, | ||
CUCUMBER_PLUGIN_TEMPLATE_DESTINATION, | ||
force | ||
) | ||
|
||
copy( | ||
CUCUMBER_CONFIG_TEMPLATE_SOURCE, | ||
CUCUMBER_CONFIG_TEMPLATE_DESTINATION, | ||
force | ||
) | ||
|
||
const { testFiles } = await prompt([ | ||
{ | ||
type: 'input', | ||
name: 'testFiles', | ||
message: 'Glob pattern for the test files to run:', | ||
default: '**/*.feature', | ||
}, | ||
]) | ||
|
||
addToJson(CYPRESS_CONFIG_PATH, { testFiles }) | ||
} | ||
|
||
module.exports = { createCucumberConfigs } |
Oops, something went wrong.