zephyr.js
zephyr.js copied to clipboard
[dynamic] Throw out error "console is not defined"
Description
When testing dynamic target, throw out error.
Test Code
/modules/Assert.js /tests/test-timers.js
Simple test1:
var fs = require('fs');
var stats = fs.statSync('timer.js');
if (stats && (stats.isFile() || stats.isDirectory())) {
console.log("This file is exist ---- ");
runJS('timer.js');
} else {
console.log("This file is not exist ---- ");
}
Simple test2:
runJS('timer.js');
Steps to Reproduction
- Copy
/modules/Assert.jsto a101 board asassert.js - Copy
/tests/test-timers.jsto a101 board astimer.js - Build simple test1 and flash it to a101 board.
- Check console log.
- Build simple test2 and flash it to a101 board.
- Check console log.
Actual Result
Logs of simple test1:
This file is exist ----
PASS - clearInterval: intervalID does not exist
PASS - clearTimeout: timeoutID does not exist
PASS - setInterval: set delay
PASS - clearInterval: intervalID
PASS - setInterval: set delay and optional arg
PASS - setTimeout: set delay
PASS - setTimeout: set delay and optional arg
PASS - setTimeout: set 20 arg for timeout
PASS - clearTimeout: timeoutID
TOTAL: 9 of 9 passed
Logs of simple test2 (throw out error and repeats in an endless loop):
288:(ERROR) Error running JS
Error: console is not defined
288:(ERROR) Error running JS
Error: console is not defined
288:(ERROR) Error running JS
Error: console is not defined
Expected Result
No error.
Test Builds
| Branch | Commit Id | Target Device | Test Date | Result |
|---|---|---|---|---|
| master | e4e4c95 | Arduino 101 | Feb 6, 2018 | Fail |