supertest icon indicating copy to clipboard operation
supertest copied to clipboard

🕷 Super-agent driven library for testing node.js HTTP servers using a fluent API. Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.

Results 149 supertest issues
Sort by recently updated
recently updated
newest added

So I'm writing some tests using Mocha, chai and supertest. I'm facing a really weird behavior here on a test that should work just fine. Here's the test code: ```...

Versions: "supertest": "6.0.1", Code example: ``` it('should fail getting all users, reason role = user', async () => { const authHeaders = {Authorization: 'test'} await request(app) .get('/user/all') .set(authHeaders) .expect(({ headers...

Supertest is not setting headers. Here is the code: it('should fail getting all users, reason role = user', async () => { const data = await request(app) .get('/user/all') .set('Authorization', token)...

I am doing this unit test with supertest and chai and I do it in these two way ``` it("POST /novedades/api/postSolicitudVacaciones (servicio de guardar una solicitud de vacaciones) ", (done)...

I use the version of 6.2.3, and wanna use agent function to save cookie to client side. But the code below can not run correctly: ```javascript const request = require('supertest');...

**my app.js code is below:-** import express from 'express'; const app = express(); app.use(cors()); const session = require('express-session'); const http = require('http').createServer(app); const io = require('socket.io').listen(http); import config from './config/environment';...

This example fails with `Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.` On mochajs.org: `In Mocha v3.0.0 and newer, returning a Promise and calling...

would be awesome to cover allowed origins, i.e.: ``` // app.js app.get('/', cors({ origin: "http://allowed.com" }), (req, res) => { res.sendStatus(200) }) // app.spec.js const resp = await supertest(app).post('/').origin('http://allowed.com') expect(resp.status).toStrictEqual(200)...