Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

[dynamic] Throw out error "console is not defined" #1851

Open
cuiyanx opened this issue Mar 6, 2018 · 0 comments
Open

[dynamic] Throw out error "console is not defined" #1851

cuiyanx opened this issue Mar 6, 2018 · 0 comments
Assignees
Labels

Comments

@cuiyanx
Copy link
Contributor

cuiyanx commented Mar 6, 2018

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

  1. Copy /modules/Assert.js to a101 board as assert.js
  2. Copy /tests/test-timers.js to a101 board as timer.js
  3. Build simple test1 and flash it to a101 board.
  4. Check console log.
  5. Build simple test2 and flash it to a101 board.
  6. 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

Additional Information

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants