MCPcopy
hub / github.com/jestjs/jest / stat

Function stat

packages/jest-haste-map/src/crawlers/__tests__/node.test.js:41–60  ·  view source on GitHub ↗
(path, callback)

Source from the content-addressed store, hash-verified

39 let mtime = 32;
40 const size = 42;
41 const stat = (path, callback) => {
42 setTimeout(
43 () =>
44 callback(null, {
45 isDirectory() {
46 return slash(path).endsWith('/directory');
47 },
48 isSymbolicLink() {
49 return slash(path).endsWith('symlink');
50 },
51 mtime: {
52 getTime() {
53 return mtime++;
54 },
55 },
56 size,
57 }),
58 0,
59 );
60 };
61 return {
62 lstat: jest.fn(stat),
63 readdir: jest.fn((dir, options, callback) => {

Callers 1

searchFunction · 0.85

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected