How to use the jsdom.getVirtualConsole function in jsdom

To help you get started, we’ve selected a few jsdom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vecnatechnologies / backbone-torso / test / spec / functional / clientEnv.js View on Github external
done: function(error, window) {
        if (argv.v) {
          jsdom.getVirtualConsole(window).sendTo(console);
        }

        if (error) {
          console.log("Error loading functional testing environment: ");
          console.log(error);
          console.log();
          reject(error)
        }

        // TODO add handlebarsUtils import function to window/ on torso. then here, add handlebars from window to handlebarsUtils
        window.Torso.Utils.handlebarsUtils(window.Handlebars);
        // This sync is needed because TestView.js imports a compiled .hbs file outside of the window's scope so it uses a different
        // Set of handlebars helpers.
        window._.each(window.Handlebars.helpers, function(helperFunction, helperName) {
          handlebars.registerHelper(helperName, helperFunction);
        });
github harc / ohm / test / test-examples.js View on Github external
created: function(error, window) {
      if (error) {
        cb([error]);
      } else {
        jsdom.getVirtualConsole(window).sendTo(console);
        window.addEventListener('error', function(evt) {
          /* eslint-disable no-console */
          console.error(
              'In ' + evt.filename + '\n' +
              'at line ' + evt.lineno + ' (relative to start of script), col ' + evt.colno + ':');
          /* eslint-enable no-console */
          errors.push(evt.error);
        });
      }
    },
    onload: function(window) {
github vecnatechnologies / backbone-torso / test / spec / import / importEnv.js View on Github external
done: function(error, window) {
        if (argv.v) {
          jsdom.getVirtualConsole(window).sendTo(console);
        }

        if (error) {
          console.log("Error loading import testing environment: ");
          console.log(error);
          console.log();
          reject(error)
        }

        resolve(window);
      }
    });
github coltonTB / ice-js / test / index.js View on Github external
created: function(error, window){
          jsdom.getVirtualConsole(window).sendTo(console);
        },
        done: function(errors, win){
github bazaarvoice / scoutfile / Gruntfile.js View on Github external
created: function (createdErr, window) {
          if (createdErr) {
            grunt.log.error(createdErr);
            return done(createdErr);
          }

          jsdom.getVirtualConsole(window).on('log', function (msg) {
            console.log('jsdom:', msg);
          });

          window.isJsdom = true;

          window.onTestsComplete = function (onTestsCompleteErr, results) {
            if (onTestsCompleteErr) {
              grunt.log.error(onTestsCompleteErr);
              return done(onTestsCompleteErr);
            }

            var $ = window.$;
            var resultText = $('#nodeunit-testresult').text();

            grunt.log[err ? 'error' : 'ok'](resultText);
github rijs / fullstack / dist / sync.js View on Github external
created: function created(e, window) {
        jsdom.getVirtualConsole(window).sendTo(console);
        window.noripple = true;
      },
      done: function done(e, window) {
github rijs / fullstack / src / sync.js View on Github external
, created: function(e, window){
        jsdom.getVirtualConsole(window).sendTo(console)
        window.noripple = true
      }
    , done: function(e, window){