Skip to content

Commit 944aa88

Browse files
committed
Use positive value in test to make sure complexity is actually calculated.
1 parent f479749 commit 944aa88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/__tests__/QueryComplexity-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ describe('QueryComplexity analysis', () => {
2626
it('should calculate complexity', () => {
2727
const ast = parse(`
2828
query {
29-
variableScalar(count: -100)
29+
variableScalar(count: 10)
3030
}
3131
`);
3232

3333
const complexity = calculateComplexity({
3434
estimators: [
35-
simpleEstimator({defaultComplexity: -100})
35+
simpleEstimator({defaultComplexity: 1})
3636
],
3737
schema,
3838
query: ast
3939
});
40-
expect(complexity).to.equal(0);
40+
expect(complexity).to.equal(1);
4141
});
4242

4343
it('should not allow negative cost', () => {

0 commit comments

Comments
 (0)