Skip to content

Commit

Permalink
test: increase test coverage on config.schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandenaardweg committed Dec 30, 2022
1 parent a77713c commit 354326d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/config.schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,25 @@ describe('config.schema.json', () => {

expect(schemaValidation).toThrowError("'co2Sensor' must be a boolean");
});

it('should error when device.nonCve is not a boolean', () => {
const invalidConfigSchema = {
platform: PLATFORM_NAME,
name: DEFAULT_BRIDGE_NAME,
api: {
ip: '192.168.0.10',
port: 1883,
protocol: 'mqtt',
},
device: {
nonCve: 'true',
},
};

const schemaValidation = () => {
configSchema.parse(invalidConfigSchema);
};

expect(schemaValidation).toThrowError("'nonCve' must be a boolean");
});
});

0 comments on commit 354326d

Please sign in to comment.