0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00
nodejs/test/mjsunit/test-file-cat-noexist.js
Ryan Dahl 7a2e784ad7 Module refactor - almost CommonJS compatible now
API change summary:

  * require("/sys.js") becomes require("sys")

  * require("circle.js") becomes require("./circle")

  * process.path.join() becomes require("path").join()
2009-10-31 19:10:30 +01:00

21 lines
489 B
JavaScript

process.mixin(require("./common"));
var got_error = false;
var filename = 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);
});