| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b4bedde commit 26a2ae2
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -119,27 +119,30 @@ assert.strictEqual(finished, promisify(stream.finished)); | |||
| 119 | 119 | { | |
| 120 | 120 | const streamObj = new Writable(); | |
| 121 | 121 | assert.strictEqual(streamObj.listenerCount('end'), 0); | |
| 122 | - finished(streamObj, { cleanup: false }).then(() => { | ||
| 122 | + finished(streamObj, { cleanup: false }).then(common.mustCall(() => { | ||
| 123 | 123 | assert.strictEqual(streamObj.listenerCount('end'), 1); | |
| 124 | - }); | ||
| 124 | + })); | ||
| 125 | + streamObj.end(); | ||
| 125 | 126 | } | |
| 126 | 127 | ||
| 127 | 128 | // Cleanup function should be called when cleanup is set to true | |
| 128 | 129 | // listenerCount should be 0 after calling finish | |
| 129 | 130 | { | |
| 130 | 131 | const streamObj = new Writable(); | |
| 131 | 132 | assert.strictEqual(streamObj.listenerCount('end'), 0); | |
| 132 | - finished(streamObj, { cleanup: true }).then(() => { | ||
| 133 | + finished(streamObj, { cleanup: true }).then(common.mustCall(() => { | ||
| 133 | 134 | assert.strictEqual(streamObj.listenerCount('end'), 0); | |
| 134 | - }); | ||
| 135 | + })); | ||
| 136 | + streamObj.end(); | ||
| 135 | 137 | } | |
| 136 | 138 | ||
| 137 | 139 | // Cleanup function should not be called when cleanup has not been set | |
| 138 | 140 | // listenerCount should be 1 after calling finish | |
| 139 | 141 | { | |
| 140 | 142 | const streamObj = new Writable(); | |
| 141 | 143 | assert.strictEqual(streamObj.listenerCount('end'), 0); | |
| 142 | - finished(streamObj).then(() => { | ||
| 144 | + finished(streamObj).then(common.mustCall(() => { | ||
| 143 | 145 | assert.strictEqual(streamObj.listenerCount('end'), 1); | |
| 144 | - }); | ||
| 146 | + })); | ||
| 147 | + streamObj.end(); | ||
| 145 | 148 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments