diff --git a/src/__tests__/http-test.js b/src/__tests__/http-test.js index 2bf94a78..7abf5b4a 100644 --- a/src/__tests__/http-test.js +++ b/src/__tests__/http-test.js @@ -2111,24 +2111,16 @@ function urlString(urlParams?: ?{ [param: string]: mixed, ... }) { it('allows for adding extensions', async () => { const app = server(); - const extensions = ({ context = {} }) => { - if (context !== null && typeof context.startTime === 'number') { - return { - runTime: 1000000010 /* Date.now() */ - context.startTime, - }; - } - - return {}; - }; - get( app, urlString(), graphqlHTTP(() => { return { schema: TestSchema, - context: { startTime: 1000000000 }, - extensions, + context: { foo: 'bar' }, + extensions({ context }) { + return { contextValue: JSON.stringify(context) }; + }, }; }), ); @@ -2140,7 +2132,7 @@ function urlString(urlParams?: ?{ [param: string]: mixed, ... }) { expect(response.status).to.equal(200); expect(response.type).to.equal('application/json'); expect(response.text).to.equal( - '{"data":{"test":"Hello World"},"extensions":{"runTime":10}}', + '{"data":{"test":"Hello World"},"extensions":{"contextValue":"{\\"foo\\":\\"bar\\"}"}}', ); });