summaryrefslogtreecommitdiff
path: root/test/parallel/test-timers-ordering.js
diff options
context:
space:
mode:
authorBeth Griggs <Bethany.Griggs@uk.ibm.com>2016-12-29 16:55:51 +0000
committerGibson Fahnestock <gib@uk.ibm.com>2017-01-03 17:18:36 +0000
commit7c77932fa2c2bafe496ff254355bf3d1457faf32 (patch)
tree87a4112802cdc81582e9fb0616261502c7cc9257 /test/parallel/test-timers-ordering.js
parent7a46b992d292654c093639df3605e818827026b6 (diff)
downloadandroid-node-v8-7c77932fa2c2bafe496ff254355bf3d1457faf32.tar.gz
android-node-v8-7c77932fa2c2bafe496ff254355bf3d1457faf32.tar.bz2
android-node-v8-7c77932fa2c2bafe496ff254355bf3d1457faf32.zip
test: refactor several parallel/test-timer tests
Change var to const/let. Simplify test-timers-uncaught-exception. PR-URL: https://github.com/nodejs/node/pull/10524 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'test/parallel/test-timers-ordering.js')
-rw-r--r--test/parallel/test-timers-ordering.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/parallel/test-timers-ordering.js b/test/parallel/test-timers-ordering.js
index 79b16338e6..853f80a66a 100644
--- a/test/parallel/test-timers-ordering.js
+++ b/test/parallel/test-timers-ordering.js
@@ -1,22 +1,22 @@
'use strict';
require('../common');
const assert = require('assert');
-var Timer = process.binding('timer_wrap').Timer;
-var N = 30;
+const Timer = process.binding('timer_wrap').Timer;
+const N = 30;
-var last_i = 0;
-var last_ts = 0;
+let last_i = 0;
+let last_ts = 0;
-var f = function(i) {
+const f = function(i) {
if (i <= N) {
// check order
- assert.equal(i, last_i + 1, 'order is broken: ' + i + ' != ' +
+ assert.strictEqual(i, last_i + 1, 'order is broken: ' + i + ' != ' +
last_i + ' + 1');
last_i = i;
// check that this iteration is fired at least 1ms later than the previous
- var now = Timer.now();
+ const now = Timer.now();
console.log(i, now);
assert(now >= last_ts + 1,
'current ts ' + now + ' < prev ts ' + last_ts + ' + 1');