Skip to content

Commit 82f3ab3

Browse files
committed
fix: restore old test
1 parent 1ecb0b6 commit 82f3ab3

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

spec/ParseGraphQLServer.spec.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,18 @@ describe('ParseGraphQLServer', () => {
166166
expect(() => parseGraphQLServer.applyGraphQL(new express())).not.toThrow();
167167
});
168168

169-
it('should apply middlewares at config.graphQLPath', async () => {
169+
it('should apply middlewares at config.graphQLPath', () => {
170170
let useCount = 0;
171-
const gqlServer = new ParseGraphQLServer(parseServer, {
172-
graphQLPath: 'somepath',
173-
});
174-
gqlServer.applyGraphQL({
175-
use: server => {
176-
useCount++;
177-
if (typeof server === 'string') {
178-
expect(server).toEqual('somepath');
179-
} else {
180-
expect(server.stack[1].regexp.toString()).toEqual('/^somepath\\/?(?=\\/|$)/i');
181-
}
182-
},
183-
});
171+
expect(() =>
172+
new ParseGraphQLServer(parseServer, {
173+
graphQLPath: 'somepath',
174+
}).applyGraphQL({
175+
use: path => {
176+
useCount++;
177+
expect(path).toEqual('somepath');
178+
},
179+
})
180+
).not.toThrow();
184181
expect(useCount).toBeGreaterThan(0);
185182
});
186183
});

0 commit comments

Comments
 (0)