Skip to content

Commit b23f662

Browse files
committed
test: add time check
Fail tests that take more than 1 second
1 parent 85e8c36 commit b23f662

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,13 @@ function runTests(engine, options) {
110110
for (i = 0; i < len; i++) {
111111
filename = filenames[i];
112112
file = files[filename];
113+
114+
var before = process.hrtime();
113115
success = testFile(engine, file, filename, i + 1);
114-
if (success) {
116+
var elapsed = process.hrtime(before);
117+
var tookLessThanOneSec = (elapsed[0] === 0);
118+
119+
if (success && tookLessThanOneSec) {
115120
succeeded++;
116121
} else {
117122
failed++;

0 commit comments

Comments
 (0)