Skip to content

Commit e99d14e

Browse files
committed
test: jsonify options
1 parent ee8b99b commit e99d14e

2 files changed

Lines changed: 64 additions & 69 deletions

File tree

test/__snapshots__/system.spec.ts.snap

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -26,45 +26,45 @@ exports[`system > 42 > mimeType 1`] = `"application/vnd.ibm.rights-management"`;
2626

2727
exports[`system > 42 > networkInterface > noArgs 1`] = `"wlp1s7"`;
2828

29-
exports[`system > 42 > networkInterface > with 1`] = `"wlp1s7"`;
29+
exports[`system > 42 > networkInterface > with {"interfaceSchema":"index"} 1`] = `"wlo7"`;
3030

31-
exports[`system > 42 > networkInterface > with interfaceSchema index 1`] = `"wlo7"`;
31+
exports[`system > 42 > networkInterface > with {"interfaceSchema":"mac"} 1`] = `"wlxcf2bc9927210"`;
3232

33-
exports[`system > 42 > networkInterface > with interfaceSchema mac 1`] = `"wlxcf2bc9927210"`;
33+
exports[`system > 42 > networkInterface > with {"interfaceSchema":"pci"} 1`] = `"wlp9s1"`;
3434

35-
exports[`system > 42 > networkInterface > with interfaceSchema pci 1`] = `"wlp9s1"`;
35+
exports[`system > 42 > networkInterface > with {"interfaceSchema":"slot"} 1`] = `"wls7d7"`;
3636

37-
exports[`system > 42 > networkInterface > with interfaceSchema slot 1`] = `"wls7d7"`;
37+
exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"index"} 1`] = `"eno3"`;
3838

39-
exports[`system > 42 > networkInterface > with interfaceType en 1`] = `"ens7d7"`;
39+
exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"mac"} 1`] = `"enx5cf2bc992721"`;
4040

41-
exports[`system > 42 > networkInterface > with interfaceType en interfaceSchema index 1`] = `"eno3"`;
41+
exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"pci"} 1`] = `"P7enp9s1"`;
4242

43-
exports[`system > 42 > networkInterface > with interfaceType en interfaceSchema mac 1`] = `"enx5cf2bc992721"`;
43+
exports[`system > 42 > networkInterface > with {"interfaceType":"en","interfaceSchema":"slot"} 1`] = `"ens3"`;
4444

45-
exports[`system > 42 > networkInterface > with interfaceType en interfaceSchema pci 1`] = `"P7enp9s1"`;
45+
exports[`system > 42 > networkInterface > with {"interfaceType":"en"} 1`] = `"ens7d7"`;
4646

47-
exports[`system > 42 > networkInterface > with interfaceType en interfaceSchema slot 1`] = `"ens3"`;
47+
exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"index"} 1`] = `"wlo3"`;
4848

49-
exports[`system > 42 > networkInterface > with interfaceType wl 1`] = `"wls7d7"`;
49+
exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"mac"} 1`] = `"wlx5cf2bc992721"`;
5050

51-
exports[`system > 42 > networkInterface > with interfaceType wl interfaceSchema index 1`] = `"wlo3"`;
51+
exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"pci"} 1`] = `"P7wlp9s1"`;
5252

53-
exports[`system > 42 > networkInterface > with interfaceType wl interfaceSchema mac 1`] = `"wlx5cf2bc992721"`;
53+
exports[`system > 42 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"slot"} 1`] = `"wls3"`;
5454

55-
exports[`system > 42 > networkInterface > with interfaceType wl interfaceSchema pci 1`] = `"P7wlp9s1"`;
55+
exports[`system > 42 > networkInterface > with {"interfaceType":"wl"} 1`] = `"wls7d7"`;
5656

57-
exports[`system > 42 > networkInterface > with interfaceType wl interfaceSchema slot 1`] = `"wls3"`;
57+
exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"index"} 1`] = `"wwo3"`;
5858

59-
exports[`system > 42 > networkInterface > with interfaceType ww 1`] = `"wws7d7"`;
59+
exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"mac"} 1`] = `"wwx5cf2bc992721"`;
6060

61-
exports[`system > 42 > networkInterface > with interfaceType ww interfaceSchema index 1`] = `"wwo3"`;
61+
exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"pci"} 1`] = `"P7wwp9s1"`;
6262

63-
exports[`system > 42 > networkInterface > with interfaceType ww interfaceSchema mac 1`] = `"wwx5cf2bc992721"`;
63+
exports[`system > 42 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"slot"} 1`] = `"wws3"`;
6464

65-
exports[`system > 42 > networkInterface > with interfaceType ww interfaceSchema pci 1`] = `"P7wwp9s1"`;
65+
exports[`system > 42 > networkInterface > with {"interfaceType":"ww"} 1`] = `"wws7d7"`;
6666

67-
exports[`system > 42 > networkInterface > with interfaceType ww interfaceSchema slot 1`] = `"wws3"`;
67+
exports[`system > 42 > networkInterface > with {} 1`] = `"wlp1s7"`;
6868

6969
exports[`system > 42 > semver 1`] = `"3.7.9"`;
7070

@@ -94,45 +94,45 @@ exports[`system > 1211 > mimeType 1`] = `"text/vnd.dmclientscript"`;
9494

9595
exports[`system > 1211 > networkInterface > noArgs 1`] = `"wws8d1"`;
9696

97-
exports[`system > 1211 > networkInterface > with 1`] = `"wws8d1"`;
97+
exports[`system > 1211 > networkInterface > with {"interfaceSchema":"index"} 1`] = `"wwo4"`;
9898

99-
exports[`system > 1211 > networkInterface > with interfaceSchema index 1`] = `"wwo4"`;
99+
exports[`system > 1211 > networkInterface > with {"interfaceSchema":"mac"} 1`] = `"wwx7ec32f0a2a3c"`;
100100

101-
exports[`system > 1211 > networkInterface > with interfaceSchema mac 1`] = `"wwx7ec32f0a2a3c"`;
101+
exports[`system > 1211 > networkInterface > with {"interfaceSchema":"pci"} 1`] = `"P8wwp7s2f9d6"`;
102102

103-
exports[`system > 1211 > networkInterface > with interfaceSchema pci 1`] = `"P8wwp7s2f9d6"`;
103+
exports[`system > 1211 > networkInterface > with {"interfaceSchema":"slot"} 1`] = `"wws4"`;
104104

105-
exports[`system > 1211 > networkInterface > with interfaceSchema slot 1`] = `"wws4"`;
105+
exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"index"} 1`] = `"eno9"`;
106106

107-
exports[`system > 1211 > networkInterface > with interfaceType en 1`] = `"P8enp7s2f9d6"`;
107+
exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"mac"} 1`] = `"enxe7ec32f0a2a3"`;
108108

109-
exports[`system > 1211 > networkInterface > with interfaceType en interfaceSchema index 1`] = `"eno9"`;
109+
exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"pci"} 1`] = `"enp4s8d1"`;
110110

111-
exports[`system > 1211 > networkInterface > with interfaceType en interfaceSchema mac 1`] = `"enxe7ec32f0a2a3"`;
111+
exports[`system > 1211 > networkInterface > with {"interfaceType":"en","interfaceSchema":"slot"} 1`] = `"ens9f8"`;
112112

113-
exports[`system > 1211 > networkInterface > with interfaceType en interfaceSchema pci 1`] = `"enp4s8d1"`;
113+
exports[`system > 1211 > networkInterface > with {"interfaceType":"en"} 1`] = `"P8enp7s2f9d6"`;
114114

115-
exports[`system > 1211 > networkInterface > with interfaceType en interfaceSchema slot 1`] = `"ens9f8"`;
115+
exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"index"} 1`] = `"wlo9"`;
116116

117-
exports[`system > 1211 > networkInterface > with interfaceType wl 1`] = `"P8wlp7s2f9d6"`;
117+
exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"mac"} 1`] = `"wlxe7ec32f0a2a3"`;
118118

119-
exports[`system > 1211 > networkInterface > with interfaceType wl interfaceSchema index 1`] = `"wlo9"`;
119+
exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"pci"} 1`] = `"wlp4s8d1"`;
120120

121-
exports[`system > 1211 > networkInterface > with interfaceType wl interfaceSchema mac 1`] = `"wlxe7ec32f0a2a3"`;
121+
exports[`system > 1211 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"slot"} 1`] = `"wls9f8"`;
122122

123-
exports[`system > 1211 > networkInterface > with interfaceType wl interfaceSchema pci 1`] = `"wlp4s8d1"`;
123+
exports[`system > 1211 > networkInterface > with {"interfaceType":"wl"} 1`] = `"P8wlp7s2f9d6"`;
124124

125-
exports[`system > 1211 > networkInterface > with interfaceType wl interfaceSchema slot 1`] = `"wls9f8"`;
125+
exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"index"} 1`] = `"wwo9"`;
126126

127-
exports[`system > 1211 > networkInterface > with interfaceType ww 1`] = `"P8wwp7s2f9d6"`;
127+
exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"mac"} 1`] = `"wwxe7ec32f0a2a3"`;
128128

129-
exports[`system > 1211 > networkInterface > with interfaceType ww interfaceSchema index 1`] = `"wwo9"`;
129+
exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"pci"} 1`] = `"wwp4s8d1"`;
130130

131-
exports[`system > 1211 > networkInterface > with interfaceType ww interfaceSchema mac 1`] = `"wwxe7ec32f0a2a3"`;
131+
exports[`system > 1211 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"slot"} 1`] = `"wws9f8"`;
132132

133-
exports[`system > 1211 > networkInterface > with interfaceType ww interfaceSchema pci 1`] = `"wwp4s8d1"`;
133+
exports[`system > 1211 > networkInterface > with {"interfaceType":"ww"} 1`] = `"P8wwp7s2f9d6"`;
134134

135-
exports[`system > 1211 > networkInterface > with interfaceType ww interfaceSchema slot 1`] = `"wws9f8"`;
135+
exports[`system > 1211 > networkInterface > with {} 1`] = `"wws8d1"`;
136136

137137
exports[`system > 1211 > semver 1`] = `"9.4.8"`;
138138

@@ -162,45 +162,45 @@ exports[`system > 1337 > mimeType 1`] = `"application/vnd.chipnuts.karaoke-mmd"`
162162

163163
exports[`system > 1337 > networkInterface > noArgs 1`] = `"enx234870538945"`;
164164

165-
exports[`system > 1337 > networkInterface > with 1`] = `"enx234870538945"`;
165+
exports[`system > 1337 > networkInterface > with {"interfaceSchema":"index"} 1`] = `"eno5"`;
166166

167-
exports[`system > 1337 > networkInterface > with interfaceSchema index 1`] = `"eno5"`;
167+
exports[`system > 1337 > networkInterface > with {"interfaceSchema":"mac"} 1`] = `"enx823487053894"`;
168168

169-
exports[`system > 1337 > networkInterface > with interfaceSchema mac 1`] = `"enx823487053894"`;
169+
exports[`system > 1337 > networkInterface > with {"interfaceSchema":"pci"} 1`] = `"enp1s2f5d0"`;
170170

171-
exports[`system > 1337 > networkInterface > with interfaceSchema pci 1`] = `"enp1s2f5d0"`;
171+
exports[`system > 1337 > networkInterface > with {"interfaceSchema":"slot"} 1`] = `"ens5f2d5"`;
172172

173-
exports[`system > 1337 > networkInterface > with interfaceSchema slot 1`] = `"ens5f2d5"`;
173+
exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"index"} 1`] = `"eno2"`;
174174

175-
exports[`system > 1337 > networkInterface > with interfaceType en 1`] = `"ens5f2d5"`;
175+
exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"mac"} 1`] = `"enx482348705389"`;
176176

177-
exports[`system > 1337 > networkInterface > with interfaceType en interfaceSchema index 1`] = `"eno2"`;
177+
exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"pci"} 1`] = `"P5enp1s2f5d0"`;
178178

179-
exports[`system > 1337 > networkInterface > with interfaceType en interfaceSchema mac 1`] = `"enx482348705389"`;
179+
exports[`system > 1337 > networkInterface > with {"interfaceType":"en","interfaceSchema":"slot"} 1`] = `"ens2d2"`;
180180

181-
exports[`system > 1337 > networkInterface > with interfaceType en interfaceSchema pci 1`] = `"P5enp1s2f5d0"`;
181+
exports[`system > 1337 > networkInterface > with {"interfaceType":"en"} 1`] = `"ens5f2d5"`;
182182

183-
exports[`system > 1337 > networkInterface > with interfaceType en interfaceSchema slot 1`] = `"ens2d2"`;
183+
exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"index"} 1`] = `"wlo2"`;
184184

185-
exports[`system > 1337 > networkInterface > with interfaceType wl 1`] = `"wls5f2d5"`;
185+
exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"mac"} 1`] = `"wlx482348705389"`;
186186

187-
exports[`system > 1337 > networkInterface > with interfaceType wl interfaceSchema index 1`] = `"wlo2"`;
187+
exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"pci"} 1`] = `"P5wlp1s2f5d0"`;
188188

189-
exports[`system > 1337 > networkInterface > with interfaceType wl interfaceSchema mac 1`] = `"wlx482348705389"`;
189+
exports[`system > 1337 > networkInterface > with {"interfaceType":"wl","interfaceSchema":"slot"} 1`] = `"wls2d2"`;
190190

191-
exports[`system > 1337 > networkInterface > with interfaceType wl interfaceSchema pci 1`] = `"P5wlp1s2f5d0"`;
191+
exports[`system > 1337 > networkInterface > with {"interfaceType":"wl"} 1`] = `"wls5f2d5"`;
192192

193-
exports[`system > 1337 > networkInterface > with interfaceType wl interfaceSchema slot 1`] = `"wls2d2"`;
193+
exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"index"} 1`] = `"wwo2"`;
194194

195-
exports[`system > 1337 > networkInterface > with interfaceType ww 1`] = `"wws5f2d5"`;
195+
exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"mac"} 1`] = `"wwx482348705389"`;
196196

197-
exports[`system > 1337 > networkInterface > with interfaceType ww interfaceSchema index 1`] = `"wwo2"`;
197+
exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"pci"} 1`] = `"P5wwp1s2f5d0"`;
198198

199-
exports[`system > 1337 > networkInterface > with interfaceType ww interfaceSchema mac 1`] = `"wwx482348705389"`;
199+
exports[`system > 1337 > networkInterface > with {"interfaceType":"ww","interfaceSchema":"slot"} 1`] = `"wws2d2"`;
200200

201-
exports[`system > 1337 > networkInterface > with interfaceType ww interfaceSchema pci 1`] = `"P5wwp1s2f5d0"`;
201+
exports[`system > 1337 > networkInterface > with {"interfaceType":"ww"} 1`] = `"wws5f2d5"`;
202202

203-
exports[`system > 1337 > networkInterface > with interfaceType ww interfaceSchema slot 1`] = `"wws2d2"`;
203+
exports[`system > 1337 > networkInterface > with {} 1`] = `"enx234870538945"`;
204204

205205
exports[`system > 1337 > semver 1`] = `"2.5.1"`;
206206

test/system.spec.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,10 @@ describe('system', () => {
5858
'pci',
5959
] as const) {
6060
for (const interfaceType of [undefined, 'en', 'wl', 'ww'] as const) {
61-
t.it(
62-
`with${interfaceType ? ` interfaceType ${interfaceType}` : ''}${
63-
interfaceSchema ? ` interfaceSchema ${interfaceSchema}` : ''
64-
}`,
65-
{
66-
interfaceType,
67-
interfaceSchema,
68-
}
69-
);
61+
t.it(`with ${JSON.stringify({ interfaceType, interfaceSchema })}`, {
62+
interfaceType,
63+
interfaceSchema,
64+
});
7065
}
7166
}
7267
});

0 commit comments

Comments
 (0)