mirror of
https://github.com/vale981/apollo-server
synced 2025-03-04 17:21:42 -05:00
get supertest working for TS
This commit is contained in:
parent
c43efe4863
commit
300b32fa5a
2 changed files with 8 additions and 4 deletions
|
@ -11,8 +11,7 @@ import {
|
|||
|
||||
// TODO use import, not require... help appreciated.
|
||||
import * as express from 'express';
|
||||
// tslint:disable-next-line
|
||||
const request = require('supertest-as-promised');
|
||||
import request from 'supertest-as-promised';
|
||||
|
||||
import { graphqlHTTP, ExpressApolloOptions, renderGraphiQL } from './expressApollo';
|
||||
|
||||
|
@ -53,7 +52,9 @@ describe('expressApollo', () => {
|
|||
};
|
||||
return request(app).get(
|
||||
'/graphql?query={ testString }'
|
||||
).then((res) => {
|
||||
)
|
||||
.expect(200)
|
||||
.then((res) => {
|
||||
return expect(res.body.data).to.deep.equal(expected);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"graphql": "github:nitintutlani/typed-graphql"
|
||||
},
|
||||
"globalDependencies": {
|
||||
"bluebird": "registry:dt/bluebird#2.0.0+20160319051630",
|
||||
"body-parser": "registry:dt/body-parser#0.0.0+20160317120654",
|
||||
"es6-promise": "registry:dt/es6-promise#0.0.0+20160317120654",
|
||||
"express": "registry:dt/express#4.0.0+20160317120654",
|
||||
|
@ -13,6 +14,8 @@
|
|||
"mime": "registry:dt/mime#0.0.0+20160316155526",
|
||||
"mocha": "registry:dt/mocha#2.2.5+20160317120654",
|
||||
"node": "registry:dt/node#6.0.0+20160524002506",
|
||||
"serve-static": "registry:dt/serve-static#0.0.0+20160501131543"
|
||||
"serve-static": "registry:dt/serve-static#0.0.0+20160501131543",
|
||||
"superagent": "registry:dt/superagent#1.4.0+20160317120654",
|
||||
"supertest-as-promised": "registry:dt/supertest-as-promised#2.0.2+20160317120654"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue