Skip to content

Commit 2846187

Browse files
msivasubramaniaandatho7561
authored andcommitted
test case added
1 parent e6165e4 commit 2846187

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/schemaValidation.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,4 +2094,20 @@ obj:
20942094
const result = await parseSetup(content);
20952095
assert.equal(result.length, 0);
20962096
});
2097+
2098+
it('value should match as per schema const on boolean', async () => {
2099+
schemaProvider.addSchema(SCHEMA_ID, {
2100+
type: 'object',
2101+
properties: {
2102+
prop: {
2103+
const: true,
2104+
type: 'boolean',
2105+
},
2106+
},
2107+
});
2108+
const content = `prop: false`;
2109+
const result = await parseSetup(content);
2110+
expect(result.length).to.eq(1);
2111+
expect(result[0].message).to.eq('Value must be true.');
2112+
});
20972113
});

0 commit comments

Comments
 (0)