Détail du package

clean-console

bahmutov111MIT0.4.0

Quickly loads remote url in phantomjs to check of JavaScript console errors

javascript, phantomjs, console, test

readme

clean-console

Quickly loads a remote page using phantomjs to check if there are any JavaScript console errors.

NPM

Build status dependencies devdependencies semantic-release

Install and use

npm install -g clean-console
// assumes phantomjs is installed
clean-console -i <url>

Note: only actual exceptions will be logged, failed console.assert statements DO NOT cause a true browser error (unlike nodejs).

A good pattern to unify nodejs/browser assertion handling is to wrap assertions into helper method:

function really(condition, message) {
    console.assert(condition, message); // stops nodejs execution
    if (!condition) {
        // stop execution in a browser
        throw new Error(condition.toString() + ' failed, ' + message);
    }
}

Update

Seems the latest PhantomJs 2 generates errors when using console.error and console.assert by default.

Small print

Author: Gleb Bahmutov © 2013

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

changelog

0.2.1 / 2014-02-01

  • returns a promise, fixes #2, with unit tests, fixes #10
  • updated pre-git, strict checking before push

0.2.0 / 2014-02-01

  • added update notifier, fixes #4
  • running gulp on pre-commit
  • running jshint using gulp, fixes #9
  • using timeout in phantomjs runner, fixes #3
  • parsing timeout argument to phantomjs runner

0.1.0 / 2014-01-21

0.0.5 / 2013-11-05

  • added travis ci build
  • added badges
  • better npm test command
  • added pre-git
  • checking if url is a local file first, before assuming it is url, fixes #9
  • supporting https://

0.0.4 / 2013-10-21

  • assuming http:// by default
  • grabbing default url from command line

0.0.3 / 2013-10-21

  • Unix end of line

0.0.2 / 2013-10-21

  • added end 2 end tests
  • passing argument url to phantomjs, updated readme
  • working initial basic example, url is hardcoded
  • wrote initial runner
  • started work on calling phantomjs
  • adding main file
  • parsing arguments
  • initial command line parsing
  • initial package
  • Initial commit