shouldjs / http Goto Github PK
View Code? Open in Web Editor NEWHttp assertions for should.js
License: MIT License
Http assertions for should.js
License: MIT License
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
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:
npm i [email protected]
make test-browser-local
and open http://localhost:4000/__zuul
in a browserCurrently 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
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
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.