()
| 23 | // ============================================================================= |
| 24 | |
| 25 | async function testBasicWrite() { |
| 26 | const filePath = path.join(tmpDir, 'writer-basic.txt'); |
| 27 | const fh = await open(filePath, 'w'); |
| 28 | const w = fh.writer(); |
| 29 | await w.write(Buffer.from('Hello ')); |
| 30 | await w.write(Buffer.from('World!')); |
| 31 | const totalBytes = await w.end(); |
| 32 | await fh.close(); |
| 33 | |
| 34 | assert.strictEqual(totalBytes, 12); |
| 35 | assert.strictEqual(fs.readFileSync(filePath, 'utf8'), 'Hello World!'); |
| 36 | } |
| 37 | |
| 38 | // ============================================================================= |
| 39 | // Basic writev() |
no test coverage detected