mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-12 12:10:44 +08:00
Add superagent and supertest definitions
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
/// <reference path="superagent.d.ts" />
|
||||
|
||||
import superagent = require('superagent')
|
||||
|
||||
var agent = superagent.agent();
|
||||
agent
|
||||
.post('http://localhost:3000/signin')
|
||||
.send({ email: 'test@dummy.com', password: 'bacon' })
|
||||
.end((err, res) => {
|
||||
if (err) throw err;
|
||||
if (res.status !== 200) throw new Error('bad status ' + res.status);
|
||||
});
|
||||
Reference in New Issue
Block a user