Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sparten11740 committed Mar 13, 2024
1 parent edbc2f1 commit c8a8cdc
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/utils/objects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@ import { flagsAsArguments } from './objects'
describe('objects', () => {
describe('stringifyFlags', () => {
it('should stringify multiple flags', () => {
expect(flagsAsArguments({ ff: true, noEdit: false, forceWithLease: true })).toEqual([
'--ff',
'--force-with-lease',
])
expect(
flagsAsArguments({ ff: true, noEdit: false, forceWithLease: true }, [
'ff',
'noEdit',
'forceWithLease',
])
).toEqual(['--ff', '--force-with-lease'])
})

it('should stringify a single flag', () => {
expect(flagsAsArguments({ forceWithLease: true })).toEqual(['--force-with-lease'])
expect(flagsAsArguments({ forceWithLease: true }, ['forceWithLease'])).toEqual([
'--force-with-lease',
])
})

it('should stringify no flags', () => {
expect(flagsAsArguments({ forceWithLease: false })).toEqual([])
expect(flagsAsArguments({})).toEqual([])
expect(flagsAsArguments({ forceWithLease: false }, ['forceWithLease'])).toEqual([])
expect(flagsAsArguments({}, [])).toEqual([])
})
})
})

0 comments on commit c8a8cdc

Please sign in to comment.