-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.test.js
More file actions
34 lines (26 loc) · 1.45 KB
/
index.test.js
File metadata and controls
34 lines (26 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const simctl = require('./simctl');
const Destination = require('./destination');
const process = require('process');
const cp = require('child_process');
const path = require('path');
test('parses destination specifier', () => {
const destination = new Destination('platform=iOS,name=iPhone 8,OS=13.4');
expect(destination.platform).toEqual('iOS');
expect(destination.name).toEqual('iPhone 8');
expect(destination.os).toEqual('13.4');
});
test('name only specifier matches different runtimes', () => {
const destination = new Destination('name=iPhone 8');
expect(destination.matchesRuntime('com.apple.CoreSimulator.SimRuntime.iOS-12-2')).toEqual(true);
expect(destination.matchesRuntime('com.apple.CoreSimulator.SimRuntime.iOS-13-4')).toEqual(true);
});
test('specifier with full platform matches runtime', () => {
const destination = new Destination('platform=iOS Simulator,name=iPhone 8');
expect(destination.matchesRuntime('com.apple.CoreSimulator.SimRuntime.iOS-12-2')).toEqual(true);
expect(destination.matchesRuntime('com.apple.CoreSimulator.SimRuntime.iOS-13-4')).toEqual(true);
});
test('specifier with full platform matches runtime and version', () => {
const destination = new Destination('platform=iOS Simulator,name=iPhone 8,OS=13.4');
expect(destination.matchesRuntime('com.apple.CoreSimulator.SimRuntime.iOS-12-2')).toEqual(false);
expect(destination.matchesRuntime('com.apple.CoreSimulator.SimRuntime.iOS-13-4')).toEqual(true);
});