Skip to content

Commit

Permalink
Fix test coverage (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: David Wu <[email protected]>
  • Loading branch information
YusakuNo1 and David Wu authored Jul 21, 2022
1 parent b6677b4 commit f9a0a84
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/scene-composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
"coverageThreshold": {
"global": {
"lines": 87.43,
"statements": 87.15,
"statements": 87.16,
"functions": 85.41,
"branches": 72.64,
"branches": 72.66,
"branchesTrue": 100
}
}
Expand Down
14 changes: 14 additions & 0 deletions packages/scene-composer/tests/utils/dataBindingUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,20 @@ describe('ruleEvaluator', () => {
expect(result).toBe('mockDefaultState');
});

it('should return default state with empty value', async () => {
const rule: IRuleBasedMap = {
statements: [
{
expression: 'temperature < 20',
target: 'mockTarget1',
},
],
};

const result = ruleEvaluator('mockDefaultState', {}, rule);
expect(result).toBe('mockDefaultState');
});

it('should return rule target if it matches', async () => {
const value = { temperature: 20 };
const rule: IRuleBasedMap = {
Expand Down

0 comments on commit f9a0a84

Please sign in to comment.