Giter Site home page Giter Site logo

javascript-karma-jasmine-capture-console-log-when-loading-demo's Introduction

JavaScript Karma Jasmine Capture "console.log" When Loading Demo

In hello.js which will be tested, there is a line:

console.log('------------ loading hello.js -----------------');

I expect when running the test, I can see the log from somewhere, but I can't, it seems only console.log inside tests will show.

Run test:

npm install
npm run test

The output:

> @ test /Users/freewind/workspace/javascript-karma-capture-console-log-when-loading-demo
> karma start karma.conf.js

01 10 2018 23:06:59.291:WARN [karma]: No captured browser, open http://localhost:9877/
01 10 2018 23:06:59.299:INFO [karma]: Karma v3.0.0 server started at http://0.0.0.0:9877/
01 10 2018 23:06:59.300:INFO [launcher]: Launching browser ChromeHeadless with unlimited concurrency
01 10 2018 23:06:59.309:INFO [launcher]: Starting browser ChromeHeadless
01 10 2018 23:06:59.715:INFO [HeadlessChrome 0.0.0 (Mac OS X 10.13.3)]: Connected on socket O9-CJOOGs9L_DnMiAAAA with id 44722210
LOG: '--------- console.log inside test ---------------'
HeadlessChrome 0.0.0 (Mac OS X 10.13.3): Executed 1 of 1 SUCCESS (0.003 secs / 0.004 secs)
TOTAL: 1 SUCCESS

Is there any way to capture the console.log in hello.js?

javascript-karma-jasmine-capture-console-log-when-loading-demo's People

Contributors

freewind avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.