@@ -8,7 +8,12 @@ const assert = require('assert');
8
8
const { NodeInstance } = require ( '../common/inspector-helper.js' ) ;
9
9
10
10
function checkListResponse ( response ) {
11
- assert . strictEqual ( 1 , response . length ) ;
11
+ const expectedLength = 1 ;
12
+ assert . strictEqual (
13
+ response . length ,
14
+ expectedLength ,
15
+ `Expected response length ${ response . length } to be ${ expectedLength } .`
16
+ ) ;
12
17
assert . ok ( response [ 0 ] . devtoolsFrontendUrl ) ;
13
18
assert . ok (
14
19
/ w s : \/ \/ l o c a l h o s t : \d + \/ [ 0 - 9 A - F a - f ] { 8 } - /
@@ -41,7 +46,11 @@ function assertScopeValues({ result }, expected) {
41
46
for ( const actual of result ) {
42
47
const value = expected [ actual . name ] ;
43
48
if ( value ) {
44
- assert . strictEqual ( value , actual . value . value ) ;
49
+ assert . strictEqual (
50
+ actual . value . value ,
51
+ value ,
52
+ `Expected scope values to be ${ actual . value . value } instead of ${ value } .`
53
+ ) ;
45
54
unmatched . delete ( actual . name ) ;
46
55
}
47
56
}
@@ -117,15 +126,24 @@ async function testBreakpoint(session) {
117
126
'generatePreview' : true
118
127
}
119
128
} ) ;
120
-
121
- assert . strictEqual ( 1002 , result . value ) ;
129
+ const expectedEvaluation = 1002 ;
130
+ assert . strictEqual (
131
+ result . value ,
132
+ expectedEvaluation ,
133
+ `Expected evaluation to be ${ expectedEvaluation } , got ${ result . value } .`
134
+ ) ;
122
135
123
136
result = ( await session . send ( {
124
137
'method' : 'Runtime.evaluate' , 'params' : {
125
138
'expression' : '5 * 5'
126
139
}
127
140
} ) ) . result ;
128
- assert . strictEqual ( 25 , result . value ) ;
141
+ const expectedResult = 25 ;
142
+ assert . strictEqual (
143
+ result . value ,
144
+ expectedResult ,
145
+ `Expected Runtime.evaluate to be ${ expectedResult } , got ${ result . value } .`
146
+ ) ;
129
147
}
130
148
131
149
async function testI18NCharacters ( session ) {
@@ -288,7 +306,13 @@ async function runTest() {
288
306
await testI18NCharacters ( session ) ;
289
307
await testCommandLineAPI ( session ) ;
290
308
await session . runToCompletion ( ) ;
291
- assert . strictEqual ( 55 , ( await child . expectShutdown ( ) ) . exitCode ) ;
309
+ const expectedExitCode = 55 ;
310
+ const { exitCode } = await child . expectShutdown ( ) ;
311
+ assert . strictEqual (
312
+ exitCode ,
313
+ expectedExitCode ,
314
+ `Expected exit code to be ${ expectedExitCode } but got ${ expectedExitCode } .`
315
+ ) ;
292
316
}
293
317
294
318
runTest ( ) ;
0 commit comments