Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit f08ee7f

Browse files
committed
test: Add a test to check if validateParams works when example is zero
1 parent 7e34be0 commit f08ee7f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/compile-uri/validate-parameters-test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ describe('validateParams', () => {
3737
})
3838
);
3939

40+
describe('when type is number and example is zero', () =>
41+
it('should set no error', () => {
42+
const params = {
43+
name: {
44+
description: 'Machine name',
45+
type: 'number',
46+
required: true,
47+
example: 0,
48+
default: '',
49+
values: []
50+
}
51+
};
52+
53+
const result = validateParams(params);
54+
assert.equal(result.errors.length, 0);
55+
})
56+
);
57+
4058
// Based on bug report:
4159
// https://github.com/apiaryio/dredd/issues/106
4260
describe('when type is string and example is a string but starting with a number', () =>

0 commit comments

Comments
 (0)