Skip to content
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

CLI: add -f option to run specific test file #616

Merged
merged 2 commits into from
Mar 14, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion detox/local-cli/detox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ program
.option('-p, --platform [ios/android]',
'Run platform specific tests. Runs tests with invert grep on \':platform:\', '
+ 'e.g test with substring \':ios:\' in its name will not run when passing \'--platform android\'')
.option('-f, --file [path]',
'Specify test file to run')
.parse(process.argv);

const config = require(path.join(process.cwd(), 'package.json')).detox;

const testFolder = getConfigFor('specs', 'e2e');
const testFolder = getConfigFor('file', 'specs', 'e2e');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getConfigFor has two params, this puts file as key, pushing specs as default value, ignoring e2e altogether. Am I missing something ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can be a good idea to extend getConfigFor to support multiple keys

const runner = getConfigFor('testRunner', 'mocha');
const runnerConfig = getConfigFor('runnerConfig', getDefaultRunnerConfig());

Expand Down