Skip to content

Commit 96a5505

Browse files
committed
Added test cases for fs-extra missing features.
1 parent dc242da commit 96a5505

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const express = require('express');
2+
const fs = require('fs-extra');
3+
const app = express();
4+
5+
app.use(express.json());
6+
7+
app.post('/rmsync', (req, res) => {
8+
const { filename } = req.body; // $ MISSING: Source
9+
10+
fs.rmSync(filename); // MISSING: $ Alert
11+
fs.rm(filename); // MISSING: $ Alert
12+
fs.rmdir(filename); // MISSING: $ Alert
13+
fs.rmdirSync(filename); // MISSING: $ Alert
14+
fs.cp(filename, "destination"); // MISSING: $ Alert
15+
fs.cp("source", filename); // MISSING: $ Alert
16+
fs.copyFileSync(filename, "destination"); // MISSING: $ Alert
17+
fs.copyFileSync("source", filename); // MISSING: $ Alert
18+
fs.cpSync(filename, "destination"); // MISSING: $ Alert
19+
fs.cpSync("source", filename); // MISSING: $ Alert
20+
fs.emptydirSync(filename); // MISSING: $ Alert
21+
fs.emptydir(filename); // MISSING: $ Alert
22+
fs.opendir(filename); // $ MISSING: Alert
23+
fs.opendirSync(filename); // $ MISSING: Alert
24+
fs.openAsBlob(filename); // $ MISSING: Alert
25+
fs.statfs(filename); // $ MISSING: Alert
26+
fs.statfsSync(filename); // $ MISSING: Alert
27+
fs.open(filename, 'r'); // $ MISSING: Alert
28+
fs.openSync(filename, 'r'); // $ MISSING: Alert
29+
fs.outputJSONSync(filename, req.body.data, { spaces: 2 }); // $ MISSING: Alert
30+
fs.lutimes(filename, new Date(req.body.atime), new Date(req.body.mtime)); // MISSING: $ Alert
31+
fs.lutimesSync(filename, new Date(req.body.atime), new Date(req.body.mtime)); // MISSING: $ Alert
32+
fs.outputJsonSync(filename, { timestamp: new Date().toISOString(), action: req.body.action, user: req.body.user}, { spaces: 2 }); // $ MISSING: Alert
33+
});

0 commit comments

Comments
 (0)