Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
chai-expected-cookie
Advanced tools
Chai plugin for testing HTTP response set-cookie header and it's also support supertest.
Chai plugin for testing HTTP response set-cookie header and it's also support supertest.
npm install chai-expected-cookie
const chai = require('chai');
const expect = chai.expect;
chai.use(require('chai-http'));
chai.use(require('chai-expected-cookie'));
response = ...
expect(response).to.containCookie({
name: 'key_1',
});
expect(response).to.not.containCookie({
name: 'key_2',
});
expect(response).to.containCookie({
name: 'key_3',
value: 'vk_3'
});
expect(response).to.containCookie({
name: 'key_4',
attrs: {
path: '/path'
}
});
expect(response).to.containCookie({
name: 'key_5',
hasAttrs: [
'httponly'
]
});
expected(response).to.containCookie({
name: 'key_6',
value: 'vk_6',
attrs: {
path: '/path'
},
hasAttrs: [
'httponly'
]
});
const chai = require('chai');
const expect = chai.expect;
chai.use(require('chai-http'));
chai.use(require('chai-expected-cookie'));
const express = require('express');
const app = express();
chai.request(app)
.get('/items')
.end(function(err, response) {
expect(response).to.containCookie({
name: 'key_1',
});
expect(response).to.not.containCookie({
name: 'key_2',
});
expect(response).to.containCookie({
name: 'key_3',
value: 'vk_3'
});
expect(response).to.containCookie({
name: 'key_4',
attrs: {
path: '/path'
}
});
expect(response).to.containCookie({
name: 'key_5',
hasAttrs: [
'httponly'
]
});
expected(response).to.containCookie({
name: 'key_6',
value: 'vk_6',
attrs: {
path: '/path'
},
hasAttrs: [
'httponly'
]
});
});
assert cookies with defined criteria is set.
Arguments
expectedCookie
- object represent expected cookie criteria
name
- cookie namevalue
- Optional cookie valueattrs
- Optional object cookie of attributeshasAttrs
- Optional array of cookie attribute namesMIT
FAQs
Chai plugin for testing HTTP response set-cookie header and it's also support supertest.
We found that chai-expected-cookie demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.