()
| 21 | tmpdir.refresh(); |
| 22 | |
| 23 | async function validateReadFile() { |
| 24 | const filePath = path.resolve(tmpDir, 'tmp-read-file.txt'); |
| 25 | await using fileHandle = await open(filePath, 'w+'); |
| 26 | const buffer = Buffer.from('Hello world'.repeat(100), 'utf8'); |
| 27 | |
| 28 | const fd = fs.openSync(filePath, 'w+'); |
| 29 | fs.writeSync(fd, buffer, 0, buffer.length); |
| 30 | fs.closeSync(fd); |
| 31 | |
| 32 | const readFileData = await fileHandle.readFile(); |
| 33 | assert.deepStrictEqual(buffer, readFileData); |
| 34 | } |
| 35 | |
| 36 | async function validateReadFileProc() { |
| 37 | // Test to make sure reading a file under the /proc directory works. Adapted |
no test coverage detected
searching dependent graphs…