({ n, type })
| 14 | }); |
| 15 | |
| 16 | function main({ n, type }) { |
| 17 | let path; |
| 18 | |
| 19 | switch (type) { |
| 20 | case 'existing': |
| 21 | path = __filename; |
| 22 | break; |
| 23 | case 'non-flat-existing': |
| 24 | path = tmpfile; |
| 25 | break; |
| 26 | case 'non-existing': |
| 27 | path = tmpdir.resolve(`.non-existing-file-${process.pid}`); |
| 28 | break; |
| 29 | default: |
| 30 | new Error('Invalid type'); |
| 31 | } |
| 32 | |
| 33 | bench.start(); |
| 34 | for (let i = 0; i < n; i++) { |
| 35 | fs.existsSync(path); |
| 36 | } |
| 37 | bench.end(n); |
| 38 | } |
nothing calls this directly
no test coverage detected