diff --git a/supertest/supertest-tests.ts b/supertest/supertest-tests.ts
index d76c97ea48..5e0de8ad8c 100644
--- a/supertest/supertest-tests.ts
+++ b/supertest/supertest-tests.ts
@@ -1,8 +1,8 @@
///
///
-import supertest = require('supertest')
-import express = require('express');
+import * as supertest from 'supertest';
+import * as express from 'express';
var app = express();
@@ -11,7 +11,7 @@ supertest(app)
.expect('Content-Type', /json/)
.expect('Content-Length', '20')
.expect(201)
- .end((err: any, res: supertest.Response) => {
+ .end((err, res) => {
if (err) throw err;
});
@@ -56,4 +56,3 @@ function hasPreviousAndNextKeys(res: supertest.Response) {
if (!('next' in res.body)) return "missing next key";
if (!('prev' in res.body)) throw new Error("missing prev key");
}
-
diff --git a/supertest/supertest.d.ts b/supertest/supertest.d.ts
index dccbd47c8b..9ca154e2f5 100644
--- a/supertest/supertest.d.ts
+++ b/supertest/supertest.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for SuperTest 0.14.0
+// Type definitions for SuperTest v1.1.0
// Project: https://github.com/visionmedia/supertest
// Definitions by: Alex Varju
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -8,7 +8,7 @@
declare module "supertest" {
import superagent = require('superagent');
- type CallbackHandler = { (err: any, res: supertest.Response): void; }|{ (res: supertest.Response): void; };
+ type CallbackHandler = (err: any, res: supertest.Response) => void;
function supertest(app: any): supertest.SuperTest;
@@ -29,6 +29,7 @@ declare module "supertest" {
expect(field: string, val: string, callback?: CallbackHandler): Test;
expect(field: string, val: RegExp, callback?: CallbackHandler): Test;
expect(checker: (res: Response) => any): Test;
+ end(callback?: CallbackHandler): Test;
}
interface Response extends superagent.Response {