* new_tests * move_all_clobbered_tests * remove all the tests that no longer exist * re-run flow tests * Move all the flow tests to tests/flow and prettier to tests/ * Move prettier tests to their own folders * Add jsfmt files * run prettier snapshot tests
34 lines
774 B
JavaScript
34 lines
774 B
JavaScript
var fs = require("fs");
|
|
|
|
/* readFile */
|
|
|
|
fs.readFile("file.exp", (_, data) => {
|
|
(data : Buffer);
|
|
});
|
|
|
|
fs.readFile("file.exp", "blah", (_, data) => {
|
|
(data : string);
|
|
});
|
|
|
|
fs.readFile("file.exp", { encoding: "blah" }, (_, data) => {
|
|
(data : string);
|
|
});
|
|
|
|
fs.readFile("file.exp", {}, (_, data) => {
|
|
(data : Buffer);
|
|
});
|
|
|
|
/* readFileSync */
|
|
|
|
(fs.readFileSync("file.exp") : Buffer);
|
|
(fs.readFileSync("file.exp") : string); // error
|
|
|
|
(fs.readFileSync("file.exp", "blah") : string);
|
|
(fs.readFileSync("file.exp", "blah") : Buffer); // error
|
|
|
|
(fs.readFileSync("file.exp", { encoding: "blah" }) : string);
|
|
(fs.readFileSync("file.exp", { encoding: "blah" }) : Buffer); // error
|
|
|
|
(fs.readFileSync("file.exp", {}) : Buffer);
|
|
(fs.readFileSync("file.exp", {}) : string); // error
|