1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-09-11 12:55:33 +03:00
phantomjs/test/basics/exit23.js
Zack Weinberg 75944c8d47 Add ability to test exit status and stdin/out/err directly.
This works with more //! directives at the top of a test, which
will normally be a no-harness test.  It is now possible, for
instance, to test for an _unsuccessful_ exit, or for output
appearing on stderr rather than stdout.  The tests for
phantom.exit and sys.stdin/out/err have been augmented
accordingly.

It is also now possible to adjust the backstop timeout on a
per-test basis, and therefore the existing timeouts have been
lowered to 5s (harness), 7s (backstop).

Part of issue #13478 (test suite overhaul).
2015-10-20 17:11:36 -04:00

10 lines
239 B
JavaScript

//! no-harness
//! expect-exit: 23
//! expect-stdout: "we are alive"
//! expect-stdout-fails
var sys = require('system');
sys.stdout.write("we are alive\n");
phantom.exit(23);
sys.stdout.write("ERROR control passed beyond phantom.exit");