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

Function syncTests

test/parallel/test-fs-utimes.js:139–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 // test synchronized code paths, these functions throw on failure
138 //
139 function syncTests() {
140 const expectedUtimesMtime = getExpectedMtime(mtime);
141 fs.utimesSync(pathType(tmpdir.path), atime, mtime);
142 expect_ok('utimesSync', tmpdir.path, undefined, atime, expectedUtimesMtime);
143
144 const expectedLutimesMtime = getExpectedMtime(mtime);
145 fs.lutimesSync(pathType(lpath), atime, mtime);
146 expect_ok('lutimesSync', lpath, undefined, atime, expectedLutimesMtime, fs.lstatSync);
147
148 // Some systems don't have futimes
149 // if there's an error, it should be ENOSYS
150 try {
151 const expectedFutimesMtime = getExpectedMtime(mtime);
152 fs.futimesSync(fd, atime, mtime);
153 expect_ok('futimesSync', fd, undefined, atime, expectedFutimesMtime);
154 } catch (ex) {
155 expect_errno('futimesSync', fd, ex, 'ENOSYS');
156 }
157
158 let err;
159 try {
160 fs.utimesSync(pathType('foobarbaz'), atime, mtime);
161 } catch (ex) {
162 err = ex;
163 }
164 expect_errno('utimesSync', 'foobarbaz', err, 'ENOENT');
165
166 err = undefined;
167 }
168}
169
170const expectTypeError = {

Callers 1

runTestsFunction · 0.85

Calls 5

getExpectedMtimeFunction · 0.85
expect_okFunction · 0.85
expect_errnoFunction · 0.85
utimesSyncMethod · 0.45
lutimesSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…