Giter Club home page Giter Club logo

http's People

Contributors

btd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

rodney-vin

http's Issues

uncaughtException TypeError: Cannot read property 'type' of undefined

Hi,
I got this error after upgrading my node env from v4.2.6 to v6.9.5 (tested with shouldjs 6.x or 7.x). Right now I'm trying to get more details, but maybe you have some ideas.

Exception caused right after,
var should = require("should");require("should-http");

uncaughtException TypeError: Cannot read property 'type' of undefined
    at module.exports (karibou-api/node_modules/should-http/http-node.js:11:25)
    at Function.should.use (karibou-api/node_modules/should/lib/should.js:143:3)

Regards, Olivier

0.1.0 breaks superagent tests

Right-hand side of 'instanceof' is not an object
at TypeChecker. (__zuul/test-bundle.js:6779:13)
at TypeChecker.getFirstMatch (__zuul/test-bundle.js:7347:32)
at TypeChecker.getType (__zuul/test-bundle.js:7355:22)

To reproduce:

  • clone superagent source
  • npm i [email protected]
  • make test-browser-local and open http://localhost:4000/__zuul in a browser

Typescript support

Currently coming across the following:

error TS7016: Could not find a declaration file for module 'should-http'. '[...]/node_modules/should-http/index.js' implicitly has an 'any' type.
  Try `npm install @types/should-http` if it exists or add a new declaration (.d.ts) file containing `declare module 'should-http';`

Has anyone come up with a declaration file yet? Or is the only option at this point to create one from scratch? Thanks

Output of should.have.status() is very hard to read

Hi,

When using should.have.status(), this is the test output I get:

unirest.get('...').end(function(res) {
  res.should.have.status(200);
  done();
});
[.....]
Uncaught AssertionError: expected {
  _consuming: true,
  _dumped: false,
  _events: {

............ 12,000 lines later ..........

  status: 405,
  statusCode: 405,
  statusType: 4,
  toJSON: [Function: toJSON],
  trailers: {},
  unauthorized: false,
  upgrade: false,
  url: ''
} to have property statusCode of 200 (got 405)�

It really is 12000 lines of serialised response object.
Would it be possible to simplify it to something like this?

expected response to have property statusCode of 200 (got 405)�

or maybe

expected response {
  body: "in case there's something useful to debug"
} to have property statusCode of 200 (got 405)

Note: for comparison, the should.have.header matcher doesn't print the entire response, it only prints the headers, which is great for debugging.

(ps: I'm running node @ 0.10.25 and should-http @ 0.0.2)

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.