• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / roku-deploy / 29763602050

20 Jul 2026 05:25PM UTC coverage: 95.074%. First build
29763602050

Pull #323

github

web-flow
Merge 14fdda615 into ba48b761e
Pull Request #323: Unified device option

694 of 747 branches covered (92.9%)

Branch coverage included in aggregate %.

74 of 94 new or added lines in 2 files covered. (78.72%)

1043 of 1080 relevant lines covered (96.57%)

33.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.23
/src/DeviceConfig.ts
1
// === Local Device ===
2

3
/**
4
 * Configuration for a local network device (IP, hostname, domain, or *.local)
5
 */
6
export interface LocalDeviceConfig {
7
    host: string;
8
}
9

10
// === RCE Device Variants ===
11

12
/**
13
 * Configuration for an RCE device addressed by ESN
14
 */
15
export interface RceDeviceConfigByEsn {
16
    esn: string;
17
    rceToken?: string;
18
}
19

20
/**
21
 * Configuration for an RCE device addressed by device ID
22
 */
23
export interface RceDeviceConfigById {
24
    id: string;
25
    rceToken?: string;
26
}
27

28
/**
29
 * Configuration for an RCE device addressed by instance URL
30
 */
31
export interface RceDeviceConfigByUrl {
32
    instanceUrl: string;
33
    rceToken?: string;
34
}
35

36
/**
37
 * Configuration for any RCE (Roku Cloud Emulator) device
38
 */
39
export type RceDeviceConfig =
40
    | RceDeviceConfigByEsn
41
    | RceDeviceConfigById
42
    | RceDeviceConfigByUrl;
43

44
/**
45
 * Configuration specifying how to connect to a device.
46
 * Either a local network device or an RCE device.
47
 */
48
export type DeviceConfig = LocalDeviceConfig | RceDeviceConfig;
49

50
/**
51
 * What the user provides as a device option.
52
 * Either a registry name (string) or an inline device config.
53
 */
54
export type DeviceOption = string | DeviceConfig;
55

56
// === Type Guards ===
57

58
/**
59
 * Check if a device config is for a local network device
60
 */
61
export function isLocalDeviceConfig(config: DeviceConfig): config is LocalDeviceConfig {
1✔
NEW
62
    return 'host' in config;
×
63
}
64

65
/**
66
 * Check if a device config is for an RCE device
67
 */
68
export function isRceDeviceConfig(config: DeviceConfig): config is RceDeviceConfig {
1✔
69
    return 'esn' in config || 'id' in config || 'instanceUrl' in config;
231✔
70
}
71

72
/**
73
 * Check if an RCE config is addressed by ESN
74
 */
75
export function isRceByEsn(config: RceDeviceConfig): config is RceDeviceConfigByEsn {
1✔
NEW
76
    return 'esn' in config;
×
77
}
78

79
/**
80
 * Check if an RCE config is addressed by device ID
81
 */
82
export function isRceById(config: RceDeviceConfig): config is RceDeviceConfigById {
1✔
NEW
83
    return 'id' in config;
×
84
}
85

86
/**
87
 * Check if an RCE config is addressed by instance URL
88
 */
89
export function isRceByUrl(config: RceDeviceConfig): config is RceDeviceConfigByUrl {
1✔
NEW
90
    return 'instanceUrl' in config;
×
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc