-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Mock xcrun calls * Await prepareIosOpts
- Loading branch information
Showing
3 changed files
with
29 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,34 @@ | ||
// transpile:mocha | ||
|
||
import * as utils from '../../lib/utils'; | ||
import chai from 'chai'; | ||
import chaiAsPromised from 'chai-as-promised'; | ||
import { withMocks } from 'appium-test-support'; | ||
import xcode from 'appium-xcode'; | ||
|
||
|
||
chai.should(); | ||
chai.use(chaiAsPromised); | ||
|
||
describe('prepareIosOpts', function () { | ||
it('should use instruments without delay by default', function () { | ||
let opts = {}; | ||
utils.prepareIosOpts(opts); | ||
describe('prepareIosOpts', withMocks({xcode}, (mocks) => { | ||
beforeEach(function () { | ||
mocks.xcode.expects('getMaxIOSSDK') | ||
.once().returns('9.3'); | ||
}); | ||
afterEach(function () { | ||
mocks.verify(); | ||
}); | ||
it('should use instruments without delay by default', async function () { | ||
const opts = {}; | ||
await utils.prepareIosOpts(opts); | ||
opts.withoutDelay.should.be.true; | ||
}); | ||
it('should use instruments without delay if explicitly not using native instruments', function () { | ||
let opts = {nativeInstrumentsLib: false}; | ||
utils.prepareIosOpts(opts); | ||
it('should use instruments without delay if explicitly not using native instruments', async function () { | ||
const opts = {nativeInstrumentsLib: false}; | ||
await utils.prepareIosOpts(opts); | ||
opts.withoutDelay.should.be.true; | ||
}); | ||
it('should not use instruments without delay if using native intruments', function () { | ||
let opts = {nativeInstrumentsLib: true}; | ||
utils.prepareIosOpts(opts); | ||
it('should not use instruments without delay if using native intruments', async function () { | ||
const opts = {nativeInstrumentsLib: true}; | ||
await utils.prepareIosOpts(opts); | ||
opts.withoutDelay.should.be.false; | ||
}); | ||
}); | ||
})); |