Comments (8)
This PR might fix it or can be used for further fixes @keithamus - #317
from chai-http.
I'll close as this is resolved in #317 but we'll likely need to release this as breaking.
from chai-http.
Seems the tests don't pass when updating superagent to the latest version. Possibly related to this.
2 failing
1) assertions
#cookie (agent):
TypeError: Cannot read properties of undefined (reading 'push')
at Agent.<computed> [as set] (node_modules/superagent/lib/agent-base.js:20:20)
at Context.<anonymous> (test/http.js:378:13)
at process.processImmediate (node:internal/timers:478:21)
2) request
Node.js
agent can be used to persist cookies:
TypeError: Cannot read properties of undefined (reading 'getCookies')
at TestAgent._attachCookies (node_modules/superagent/lib/node/agent.js:75:30)
at TestAgent.<computed> [as get] (lib/request.js:220:404)
at Context.<anonymous> (test/request.js:192:10)
at process.processImmediate (node:internal/timers:478:21)
from chai-http.
Dependabot cannot update formidable to a non-vulnerable version
The latest possible version that can be installed is 2.1.2 because of the following conflicting dependencies:
[email protected] requires formidable@^2.1.2 via [email protected]
No patched version available for formidableThe earliest fixed version is 3.2.4.
Dependabot note about this
from chai-http.
PRs welcome!
from chai-http.
in chai-http in particular, i suspect its because superagent now wraps Agent
in a proxy
so this line:
Line 310 in cc58a4b
doesn't do what it looks like it does. it looks like its trying to call the super
constructor, but it will actually call superagent's Proxy
function which returns the instance (i.e. it won't mutate this
)
tbh maybe chai-http
just needs a modernisation in a major release - turn all the prototypes into classes, etc
from chai-http.
turn all the prototypes into classes, etc
You may well be right. But to be honest, I just want to stop my npm install to stop yelling at me about 'critical' vulnerabilities. 😬
from chai-http.
yeah i get that. unfortunately, superagent doesn't export the underlying Agent
class for us to new up
they kinda borked things with that Proxy
here:
https://github.com/ladjs/superagent/blob/b368f62b3d9beae564e8dca1eb1969fc7d10580e/src/node/agent.js#L102-L110
means it will new
one up but unbound, i.e. not bound to thisArg
from chai-http.
Related Issues (20)
- Issue with MongoDB ObjectId in tested function?
- Assertion error expending cookie
- [possibly bug] aws-sdk and multer-s3 with chai-http agent promise not resolved HOT 1
- Issues and PRs are piling. Are maintainers needed? HOT 1
- How to send gzip compressed body
- publish to npm actual version HOT 2
- Found CVE-2022-29622 in one of your dependent library- superagent
- How to send multiple json in post request using supertest
- Vulnerability in cookiejar CVE-2022-25901 HOT 1
- (Property 'calledWith' does not exist on type 'Assertion') error as soon as I add chai-http to my project HOT 5
- How to use chai-http and chai 5? HOT 6
- Rework to using classes instead of prototypes
- Update some "low" hanging dependencies HOT 1
- Update npm packages for releasing
- Raise git-build versions
- document the way to use chain 5 and import to get chai-http request
- Unable to use chai-http with chai 5 HOT 1
- error TS2339: Property 'post' does not exist on type 'Agent' HOT 3
- Not able to require the chai-http as commonjs() in latest version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chai-http.