-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Basic support for Jest runner #335
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d5d93cc
Add basic jest runner support
ba08fba
Adjust Jest documentation
8bf5abd
Add missing --runInBand flag to jest command
bcb0174
Use process.env instead of process.argv (not supported in Jest)
9157bb0
Merge branch 'master' into feature/support-jest-runner
Kureev efe3b39
Adjust tests to the new env approach
c3c0077
Adjust indentation in package.json
92a1c49
Add process.env to child process
Kureev 14d6965
Support runner option in detox config
Kureev 256af2b
Update Guide.Jest to document a new way of changing runner
Kureev afcfc0e
Revert mocha.opts change (not a part of the scope)
Kureev 8fde423
Revert formatting changes (not a part of the scope)
Kureev 8c9dc3b
Use alternative flow to handle env variables
8092625
Support argv and priorotize them over env vars
dc45bc2
Cleanup detox-test.js
Kureev 63b4519
Setup debug-synchronization value
Kureev 35e0f65
Fix runner problem
Kureev 3803b47
Reset example.xcodeproj
Kureev 21690b8
Merge branch 'master' into feature/support-jest-runner
Kureev 5fcfa4a
Remove constant override
Kureev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
@@ -1,20 +1,39 @@ | ||
const _ = require('lodash'); | ||
jest.unmock('process'); | ||
|
||
describe('argparse', () => { | ||
let argparse; | ||
describe('using env variables', () => { | ||
let argparse; | ||
|
||
beforeEach(() => { | ||
jest.mock('minimist'); | ||
const minimist = require('minimist'); | ||
minimist.mockReturnValue({test: 'a value'}); | ||
argparse = require('./argparse'); | ||
}); | ||
beforeEach(() => { | ||
process.env.fooBar = 'a value'; | ||
argparse = require('./argparse'); | ||
}); | ||
|
||
it(`nonexistent key should return undefined result`, () => { | ||
expect(argparse.getArgValue('blah')).not.toBeDefined(); | ||
}); | ||
|
||
it(`nonexistent key should return undefined result`, () => { | ||
expect(argparse.getArgValue('blah')).not.toBeDefined(); | ||
it(`existing key should return a result`, () => { | ||
expect(argparse.getArgValue('foo-bar')).toBe('a value'); | ||
}); | ||
}); | ||
|
||
it(`existing key should return a result`, () => { | ||
expect(argparse.getArgValue('test')).toBe('a value'); | ||
describe('using arguments', () => { | ||
let argparse; | ||
|
||
beforeEach(() => { | ||
jest.mock('minimist'); | ||
const minimist = require('minimist'); | ||
minimist.mockReturnValue({'kebab-case-key': 'a value'}); | ||
argparse = require('./argparse'); | ||
}); | ||
|
||
it(`nonexistent key should return undefined result`, () => { | ||
expect(argparse.getArgValue('blah')).not.toBeDefined(); | ||
}); | ||
|
||
it(`existing key should return a result`, () => { | ||
expect(argparse.getArgValue('kebab-case-key')).toBe('a value'); | ||
}); | ||
}); | ||
}); |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will running without the flag run tests serially?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the flag here so if you use
detox test -r jest
it is always thereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is stopping detox from parallelism?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few things, mainly controlling multiple simulators. It's in our roadmap, shouldn't be too hard.