-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic support for Jest runner (#335)
Add basic Jest runner support in Detox core and detox-cli
- Loading branch information
Showing
6 changed files
with
112 additions
and
62 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
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