From 3af376b85294e4605dd69a6ac17224cd3d8881bf Mon Sep 17 00:00:00 2001
From: Adi Roiban <adi.roiban@chevah.com>
Date: Tue, 12 Jun 2018 13:06:57 +0100
Subject: [PATCH] Forwared the exit code from phantom to the npm script.

---
 tests/test.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/test.js b/tests/test.js
index 782d4a8..f4fed5f 100644
--- a/tests/test.js
+++ b/tests/test.js
@@ -8,8 +8,9 @@ var server = connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071
 	if (process.argv.indexOf('--phantomjs') !== -1) {
 		childProcess.spawn('node_modules/.bin/mocha-phantomjs', ['http://localhost:8071/tests/tests.html'], {
 			stdio: 'inherit'
-		}).on('exit', function() {
+		}).on('exit', function(code) {
 			server.close();
+			process.exit(code);  // eslint-disable-line no-process-exit
 		});
 
 	} else {