()
| 167 | |
| 168 | // merge() accepts object-like sources that are normalized via from() |
| 169 | async function testMergeObjectLikeSources() { |
| 170 | const arrayBuffer = new TextEncoder().encode('abc').buffer; |
| 171 | const dataView = new DataView(new TextEncoder().encode('def').buffer); |
| 172 | const streamable = { |
| 173 | [toStreamable]() { |
| 174 | return 'ghi'; |
| 175 | }, |
| 176 | }; |
| 177 | const asyncStreamable = { |
| 178 | [toAsyncStreamable]() { |
| 179 | return Promise.resolve('jkl'); |
| 180 | }, |
| 181 | }; |
| 182 | |
| 183 | assert.strictEqual(await text(merge(arrayBuffer)), 'abc'); |
| 184 | assert.strictEqual(await text(merge(dataView)), 'def'); |
| 185 | assert.strictEqual(await text(merge(streamable)), 'ghi'); |
| 186 | assert.strictEqual(await text(merge(asyncStreamable)), 'jkl'); |
| 187 | } |
| 188 | |
| 189 | // ============================================================================= |
| 190 | // Merge cleanup error handling |
no test coverage detected