From 5feccc07b0b34c74a94af37d2c666632a1c9f2c6 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 28 Oct 2016 08:36:14 -0700 Subject: [PATCH 1/2] test: require this module using correct syntax A module X can only require a module Y if it depends on it in its package.json and its installed. nodereport cannot depend on itself, so it cannot require itself by name, it has to require itself by path. --- test/test_1.js | 2 +- test/test_2.js | 2 +- test/test_3.js | 2 +- test/test_4.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_1.js b/test/test_1.js index d69c566..6d980f9 100644 --- a/test/test_1.js +++ b/test/test_1.js @@ -1,5 +1,5 @@ // NodeReport API example -var nodereport = require('nodereport'); +var nodereport = require('../'); console.log('api_call.js: triggering a NodeReport via API call...'); diff --git a/test/test_2.js b/test/test_2.js index e182b78..8f4b45d 100644 --- a/test/test_2.js +++ b/test/test_2.js @@ -1,5 +1,5 @@ // Testcase to produce an uncaught exception -require('nodereport').setEvents("exception"); +require('../').setEvents("exception"); console.log('exception.js: throwing an uncaught user exception....'); diff --git a/test/test_3.js b/test/test_3.js index 486f730..a04c286 100644 --- a/test/test_3.js +++ b/test/test_3.js @@ -1,5 +1,5 @@ // Testcase to produce a fatal error (javascript heap OOM) -require('nodereport').setEvents("fatalerror"); +require('../').setEvents("fatalerror"); console.log('fatalerror.js: allocating excessive javascript heap memory....'); var list = []; diff --git a/test/test_4.js b/test/test_4.js index 3858d91..4ac2bdc 100644 --- a/test/test_4.js +++ b/test/test_4.js @@ -1,5 +1,5 @@ // Testcase to loop in Javascript code -require('nodereport').setEvents("signal"); +require('../').setEvents("signal"); console.log('loop.js: going into loop now.... use kill -USR2 to trigger NodeReport'); From e86b64ed0313d87562e6235a4fc1f6d57745b295 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 28 Oct 2016 08:39:13 -0700 Subject: [PATCH 2/2] .gitignore the test autorun log file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8019913..e19ac5f 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ NodeReport*.txt npm-debug.log nodereport-*.tgz +nodereport_test.log