Skip to content

Commit d653492

Browse files
committed
test: Add config validation test for non-boolean allowRegex value
1 parent 5d1f3b0 commit d653492

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spec/RequestComplexity.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ describe('request complexity', () => {
112112
);
113113
});
114114

115+
it('should reject non-boolean value for allowRegex', async () => {
116+
await expectAsync(
117+
reconfigureServer({
118+
requestComplexity: { allowRegex: 'yes' },
119+
})
120+
).toBeRejectedWith(
121+
new Error('requestComplexity.allowRegex must be a boolean.')
122+
);
123+
});
124+
115125
it('should reject unknown properties', async () => {
116126
await expectAsync(
117127
reconfigureServer({

0 commit comments

Comments
 (0)