MCPcopy Create free account
hub / github.com/nodejs/node / validateReadFileProc

Function validateReadFileProc

test/parallel/test-fs-promises-readfile.js:30–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30async function validateReadFileProc() {
31 // Test to make sure reading a file under the /proc directory works. Adapted
32 // from test-fs-read-file-sync-hostname.js.
33 // Refs:
34 // - https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0
35 // - https://github.com/nodejs/node/issues/21331
36
37 // Test is Linux-specific.
38 if (!common.isLinux)
39 return;
40
41 const hostname = await readFile('/proc/sys/kernel/hostname');
42 assert.ok(hostname.length > 0);
43}
44
45function validateReadFileAbortLogicBefore() {
46 const signal = AbortSignal.abort();

Callers 1

Calls 2

readFileFunction · 0.70
okMethod · 0.45

Tested by

no test coverage detected