| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 29c4b07 commit ca9b781
98 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -90,23 +90,23 @@ if (process.argv[2] === 'child') { | |||
| 90 | 90 | ||
| 91 | 91 | switch (state) { | |
| 92 | 92 | case 'initial': | |
| 93 | - assert(/^uv loop at \[.+\] has open handles:$/.test(line), line); | ||
| 93 | + assert.match(line, /^uv loop at \[.+\] has open handles:$/); | ||
| 94 | 94 | state = 'handle-start'; | |
| 95 | 95 | break; | |
| 96 | 96 | case 'handle-start': | |
| 97 | 97 | if (/^uv loop at \[.+\] has \d+ open handles in total$/.test(line)) { | |
| 98 | 98 | state = 'assertion-failure'; | |
| 99 | 99 | break; | |
| 100 | 100 | } | |
| 101 | - assert(/^\[.+\] timer( \(active\))?$/.test(line), line); | ||
| 101 | + assert.match(line, /^\[.+\] timer( \(active\))?$/); | ||
| 102 | 102 | state = 'close-callback'; | |
| 103 | 103 | break; | |
| 104 | 104 | case 'close-callback': | |
| 105 | - assert(/^Close callback:/.test(line), line); | ||
| 105 | + assert.match(line, /^Close callback:/); | ||
| 106 | 106 | state = 'data'; | |
| 107 | 107 | break; | |
| 108 | 108 | case 'data': | |
| 109 | - assert(/^Data: .+$/.test(line), line); | ||
| 109 | + assert.match(line, /^Data: .+$/); | ||
| 110 | 110 | state = 'maybe-first-field'; | |
| 111 | 111 | break; | |
| 112 | 112 | case 'maybe-first-field': | |
@@ -116,7 +116,7 @@ if (process.argv[2] === 'child') { | |||
| 116 | 116 | state = 'handle-start'; | |
| 117 | 117 | break; | |
| 118 | 118 | case 'assertion-failure': | |
| 119 | - assert(/Assertion .+ failed/.test(line), line); | ||
| 119 | + assert.match(line, /Assertion .+ failed/); | ||
| 120 | 120 | state = 'done'; | |
| 121 | 121 | break; | |
| 122 | 122 | case 'done': | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,4 +12,4 @@ const err = binding.errno(); | |||
| 12 | 12 | assert.strictEqual(err.syscall, 'syscall'); | |
| 13 | 13 | assert.strictEqual(err.errno, 10); | |
| 14 | 14 | assert.strictEqual(err.path, 'päth'); | |
| 15 | - assert.ok(/^Error:\s\w+, some error msg 'päth'$/.test(err.toString())); | ||
| 15 | + assert.match(err.toString(), /^Error:\s\w+, some error msg 'päth'$/); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,11 +54,11 @@ if (process.argv[2] === 'child') { | |||
| 54 | 54 | ||
| 55 | 55 | child.on('close', common.mustCall((code) => { | |
| 56 | 56 | assert.strictEqual(code, 1); | |
| 57 | - assert.ok(heartbeatMsg.test(outData.toString()), | ||
| 58 | - 'did not crash until we reached offending line of code ' + | ||
| 59 | - `(found ${outData})`); | ||
| 60 | - assert.ok(corruptedMsg.test(errData.toString()), | ||
| 61 | - 'printed error contains corrupted message ' + | ||
| 62 | - `(found ${errData})`); | ||
| 57 | + assert.match(outData.toString(), heartbeatMsg, | ||
| 58 | + 'did not crash until we reached offending line of code ' + | ||
| 59 | + `(found ${outData})`); | ||
| 60 | + assert.match(errData.toString(), corruptedMsg, | ||
| 61 | + 'printed error contains corrupted message ' + | ||
| 62 | + `(found ${errData})`); | ||
| 63 | 63 | })); | |
| 64 | 64 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,11 +54,11 @@ if (process.argv[2] === 'child') { | |||
| 54 | 54 | ||
| 55 | 55 | child.on('close', common.mustCall((code) => { | |
| 56 | 56 | assert.strictEqual(code, 1); | |
| 57 | - assert.ok(heartbeatMsg.test(outData.toString()), | ||
| 58 | - 'did not crash until we reached offending line of code ' + | ||
| 59 | - `(found ${outData})`); | ||
| 60 | - assert.ok(corruptedMsg.test(errData.toString()), | ||
| 61 | - 'printed error contains corrupted message ' + | ||
| 62 | - `(found ${errData})`); | ||
| 57 | + assert.match(outData.toString(), heartbeatMsg, | ||
| 58 | + 'did not crash until we reached offending line of code ' + | ||
| 59 | + `(found ${outData})`); | ||
| 60 | + assert.match(errData.toString(), corruptedMsg, | ||
| 61 | + 'printed error contains corrupted message ' + | ||
| 62 | + `(found ${errData})`); | ||
| 63 | 63 | })); | |
| 64 | 64 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,11 +53,11 @@ if (process.argv[2] === 'child') { | |||
| 53 | 53 | ||
| 54 | 54 | child.on('close', common.mustCall((code) => { | |
| 55 | 55 | assert.strictEqual(code, 1); | |
| 56 | - assert.ok(heartbeatMsg.test(outData.toString()), | ||
| 57 | - 'did not crash until we reached offending line of code ' + | ||
| 58 | - `(found ${outData})`); | ||
| 59 | - assert.ok(corruptedMsg.test(errData.toString()), | ||
| 60 | - 'printed error contains corrupted message ' + | ||
| 61 | - `(found ${errData})`); | ||
| 56 | + assert.match(outData.toString(), heartbeatMsg, | ||
| 57 | + 'did not crash until we reached offending line of code ' + | ||
| 58 | + `(found ${outData})`); | ||
| 59 | + assert.match(errData.toString(), corruptedMsg, | ||
| 60 | + 'printed error contains corrupted message ' + | ||
| 61 | + `(found ${errData})`); | ||
| 62 | 62 | })); | |
| 63 | 63 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,11 +57,11 @@ if (process.argv[2] === 'child') { | |||
| 57 | 57 | ||
| 58 | 58 | child.on('close', common.mustCall((code) => { | |
| 59 | 59 | assert.strictEqual(code, 1); | |
| 60 | - assert.ok(heartbeatMsg.test(outData.toString()), | ||
| 61 | - 'did not crash until we reached offending line of code ' + | ||
| 62 | - `(found ${outData})`); | ||
| 63 | - assert.ok(corruptedMsg.test(errData.toString()), | ||
| 64 | - 'printed error contains corrupted message ' + | ||
| 65 | - `(found ${errData})`); | ||
| 60 | + assert.match(outData.toString(), heartbeatMsg, | ||
| 61 | + 'did not crash until we reached offending line of code ' + | ||
| 62 | + `(found ${outData})`); | ||
| 63 | + assert.match(errData.toString(), corruptedMsg, | ||
| 64 | + 'printed error contains corrupted message ' + | ||
| 65 | + `(found ${errData})`); | ||
| 66 | 66 | })); | |
| 67 | 67 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -547,7 +547,7 @@ function _expectWarning(name, expected, code) { | |||
| 547 | 547 | if (typeof message === 'string') { | |
| 548 | 548 | assert.strictEqual(warning.message, message); | |
| 549 | 549 | } else { | |
| 550 | - assert(message.test(warning.message)); | ||
| 550 | + assert.match(warning.message, message); | ||
| 551 | 551 | } | |
| 552 | 552 | assert.strictEqual(warning.code, code); | |
| 553 | 553 | }, expected.length); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -146,7 +146,7 @@ function _validateContent(report, fields = []) { | |||
| 146 | 146 | header.networkInterfaces.forEach((iface) => { | |
| 147 | 147 | assert.strictEqual(typeof iface.name, 'string'); | |
| 148 | 148 | assert.strictEqual(typeof iface.internal, 'boolean'); | |
| 149 | - assert(/^([0-9A-F][0-9A-F]:){5}[0-9A-F]{2}$/i.test(iface.mac)); | ||
| 149 | + assert.match(iface.mac, /^([0-9A-F][0-9A-F]:){5}[0-9A-F]{2}$/i); | ||
| 150 | 150 | ||
| 151 | 151 | if (iface.family === 'IPv4') { | |
| 152 | 152 | assert.strictEqual(net.isIPv4(iface.address), true); | |
@@ -171,7 +171,7 @@ function _validateContent(report, fields = []) { | |||
| 171 | 171 | assert(typeof frame === 'object' && frame !== null); | |
| 172 | 172 | checkForUnknownFields(frame, ['pc', 'symbol']); | |
| 173 | 173 | assert.strictEqual(typeof frame.pc, 'string'); | |
| 174 | - assert(/^0x[0-9a-f]+$/.test(frame.pc)); | ||
| 174 | + assert.match(frame.pc, /^0x[0-9a-f]+$/); | ||
| 175 | 175 | assert.strictEqual(typeof frame.symbol, 'string'); | |
| 176 | 176 | }); | |
| 177 | 177 | ||
@@ -250,7 +250,7 @@ function _validateContent(report, fields = []) { | |||
| 250 | 250 | report.libuv.forEach((resource) => { | |
| 251 | 251 | assert.strictEqual(typeof resource.type, 'string'); | |
| 252 | 252 | assert.strictEqual(typeof resource.address, 'string'); | |
| 253 | - assert(/^0x[0-9a-f]+$/.test(resource.address)); | ||
| 253 | + assert.match(resource.address, /^0x[0-9a-f]+$/); | ||
| 254 | 254 | assert.strictEqual(typeof resource.is_active, 'boolean'); | |
| 255 | 255 | assert.strictEqual(typeof resource.is_referenced, | |
| 256 | 256 | resource.type === 'loop' ? 'undefined' : 'boolean'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -142,7 +142,7 @@ TEST(function test_lookup_ipv6_hint(done) { | |||
| 142 | 142 | assert(err instanceof Error); | |
| 143 | 143 | assert.strictEqual(err.code, 'EAI_BADFLAGS'); | |
| 144 | 144 | assert.strictEqual(err.hostname, addresses.INET_HOST); | |
| 145 | - assert.ok(/getaddrinfo EAI_BADFLAGS/.test(err.message)); | ||
| 145 | + assert.match(err.message, /getaddrinfo EAI_BADFLAGS/); | ||
| 146 | 146 | done(); | |
| 147 | 147 | return; | |
| 148 | 148 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -527,7 +527,7 @@ TEST(function test_lookup_failure(done) { | |||
| 527 | 527 | assert.ok(err instanceof Error); | |
| 528 | 528 | assert.strictEqual(err.code, dns.NOTFOUND); | |
| 529 | 529 | assert.strictEqual(err.code, 'ENOTFOUND'); | |
| 530 | - assert.ok(!/ENOENT/.test(err.message)); | ||
| 530 | + assert.doesNotMatch(err.message, !/ENOENT/); | ||
| 531 | 531 | assert.ok(err.message.includes(addresses.NOT_FOUND)); | |
| 532 | 532 | ||
| 533 | 533 | done(); | |
@@ -640,7 +640,7 @@ TEST(function test_lookupservice_invalid(done) { | |||
| 640 | 640 | const req = dns.lookupService('1.2.3.4', 80, (err) => { | |
| 641 | 641 | assert(err instanceof Error); | |
| 642 | 642 | assert.strictEqual(err.code, 'ENOTFOUND'); | |
| 643 | - assert.ok(/1\.2\.3\.4/.test(err.message)); | ||
| 643 | + assert.match(err.message, /1\.2\.3\.4/); | ||
| 644 | 644 | ||
| 645 | 645 | done(); | |
| 646 | 646 | }); | |
@@ -662,7 +662,7 @@ TEST(function test_reverse_failure(done) { | |||
| 662 | 662 | assert(err instanceof Error); | |
| 663 | 663 | assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code... | |
| 664 | 664 | assert.strictEqual(err.hostname, '203.0.113.0'); | |
| 665 | - assert.ok(/203\.0\.113\.0/.test(err.message)); | ||
| 665 | + assert.match(err.message, /203\.0\.113\.0/); | ||
| 666 | 666 | ||
| 667 | 667 | done(); | |
| 668 | 668 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments