Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

supertest-session

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supertest-session - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

release.sh

4

package.json
{
"name": "supertest-session",
"version": "2.0.1",
"version": "3.0.0",
"description": "Cookie-based session persistence for Supertest",

@@ -36,3 +36,3 @@ "main": "index.js",

"object-assign": "^4.0.1",
"supertest": "^1.1.0"
"supertest": "^2.0.1"
},

@@ -39,0 +39,0 @@ "devDependencies": {

@@ -50,8 +50,30 @@ # Supertest sessions

});
```
it('should get a restricted page', function (done) {
testSession.get('/restricted')
.expect(200)
.end(done)
You can set preconditions:
```js
describe('after authenticating session', function () {
var authenticatedSession;
beforeEach(function (done) {
testSession.post('/signin')
.send({ username: 'foo', password: 'password' })
.expect(200)
.end(function (err) {
if (err) return done(err);
authenticatedSession = testSession;
return done();
});
});
it('should get a restricted page', function (done) {
authenticatedSession.get('/restricted')
.expect(200)
.end(done)
});
});
```

@@ -58,0 +80,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc