0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/mjsunit/test-file-cat-noexist.js
Ryan Dahl 3d8b14e6f7 node.fs.* moved into "/posix.js"
use require("/posix.js") to access them.
2009-10-28 22:45:46 +01:00

21 lines
492 B
JavaScript

node.mixin(require("common.js"));
var got_error = false;
var filename = node.path.join(fixturesDir, "does_not_exist.txt");
var promise = posix.cat(filename, "raw");
promise.addCallback(function (content) {
debug("cat returned some content: " + content);
debug("this shouldn't happen as the file doesn't exist...");
assertTrue(false);
});
promise.addErrback(function () {
got_error = true;
});
process.addListener("exit", function () {
puts("done");
assertTrue(got_error);
});