Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
  • Loading branch information
shilman and greptile-apps[bot] authored Feb 6, 2025
1 parent 0dc0d0c commit 68f742a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/core/src/csf/includeConditionalArg.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('testValue', () => {
['undefined', { eq: undefined }, undefined, false],
['undefined false', { eq: 1 }, undefined, false],
['object true', { eq: { x: 1 } }, { x: 1 }, true],
['object true', { eq: { x: 1 } }, { x: 2 }, false],
['object false', { eq: { x: 1 } }, { x: 2 }, false],
])('%s', (_name, cond, value, expected) => {
expect(testValue(cond, value)).toBe(expected);
});
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('includeConditionalArg', () => {
`[Error: Invalid conditional value {"arg":"a","global":"b"}]`
);
});
it('should throw if mulitiple exists / eq / neq are specified', () => {
it('should throw if multiple exists / eq / neq are specified', () => {
expect(() =>
includeConditionalArg({ if: { arg: 'a', exists: true, eq: 1 } }, {}, {})
).toThrowErrorMatchingInlineSnapshot(
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('includeConditionalArg', () => {
describe('eq', () => {
it.each([
['scalar true', { if: { global: 'a', eq: 1 } }, {}, { a: 1 }, true],
['scalar false', { if: { arg: 'a', eq: 1 } }, { a: 2 }, { a: 1 }, false],
['scalar false', { if: { global: 'a', eq: 1 } }, { a: 2 }, { a: 1 }, false],
])('%s', (_name, argType, args, globals, expected) => {
expect(includeConditionalArg(argType, args, globals)).toBe(expected);

Check failure on line 151 in code/core/src/csf/includeConditionalArg.test.ts

View workflow job for this annotation

GitHub Actions / Core Unit Tests, windows-latest

src/csf/includeConditionalArg.test.ts > includeConditionalArg > globals > eq > scalar false

AssertionError: expected true to be false // Object.is equality - Expected + Received - false + true ❯ src/csf/includeConditionalArg.test.ts:151:63
});
Expand Down

0 comments on commit 68f742a

Please sign in to comment.