MCPcopy Index your code
hub / github.com/nodejs/node / doWriteInvalidValues

Function doWriteInvalidValues

test/parallel/test-fs-promises-file-handle-writeFile.js:173–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171}
172
173async function doWriteInvalidValues() {
174 const fileHandle = await open(dest, 'w+');
175 try {
176 await Promise.all(
177 [42, 42n, {}, Symbol('42'), true, undefined, null, NaN].map((value) =>
178 assert.rejects(
179 fileHandle.writeFile(value),
180 { code: 'ERR_INVALID_ARG_TYPE' }
181 )
182 )
183 );
184 } finally {
185 await fileHandle.close();
186 }
187}
188
189(async () => {
190 await validateWriteFile();

Calls 6

allMethod · 0.80
openFunction · 0.70
mapMethod · 0.65
closeMethod · 0.65
SymbolFunction · 0.50
writeFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…