Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wallaby and prototype error

The thing is that prototype is not defined , although in the node console writing http.IncomingMessage.prototype does give an object as an output. Any Ideas ?

var req = Object.create(http.IncomingMessage.prototype)


Uncaught TypeError: Cannot read property 'prototype' of undefined
at http://localhost:62625/____wallaby-bundle.js?1501265946287&wallabyFileId=bundle:219253
like image 358
Jerzy Gruszka Avatar asked Jul 28 '17 18:07

Jerzy Gruszka


People also ask

What is Wallaby diagnostics report?

Often the root cause of a Wallaby problem is an error in your tests/application code, or else a problem with your test runner configuration. Wallaby Diagnostics Report is a simple JSON text report that contains some basic information about your Wallaby config and project that is required to start troubleshooting most of Wallaby issues.

Why is my wallaby config and Sample Repository not working?

In our experience, questions and issues with attached wallaby config and sample repository are resolved faster. Often, you may experience issues because your testing framework has cached a previous result or is serving the wrong file when running your tests.

Does wallaby report console error calls?

Wallaby.js reports console output, including console.error calls, for specific tests, but sometimes you may need to always be notified if somewhere in your tests, app or frameworks that you app is using, console.error is called.

How to run Wallaby tests in Node JS?

If you want to use wallaby.js to run your node.js tests or to run your tests using the latest Chromium/V8 via Electron, you will also need to specify env configuration property. As wallaby.js JavaScript file is executed in node.js environment, you can require any locally installed modules, and write and execute any code you need.


1 Answers

I think http.IncomingMessage is undefined.

It may happened http has been overridden some where in your code .

var http = require('http');
var req = Object.create(http.IncomingMessage.prototype)

I have tested the above code and it works.

like image 92
Sridhar Avatar answered Sep 27 '22 18:09

Sridhar