0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/mjsunit/test-fs-stat.js
Ryan 723c7d9f7c Replace onExit() with process.addListener("exit")
- Update documentation.

- Depreciation message for onExit().
2009-08-26 22:14:44 +02:00

25 lines
416 B
JavaScript

include("mjsunit.js");
var got_error = false;
var got_success = false;
var stats;
var promise = node.fs.stat(".");
promise.addCallback(function (_stats) {
stats = _stats;
p(stats);
got_success = true;
});
promise.addErrback(function () {
got_error = true;
});
process.addListener("exit", function () {
assertTrue(got_success);
assertFalse(got_error);
assertTrue(stats.mtime instanceof Date);
});