-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add directory flag --directory
- Loading branch information
1 parent
1d65666
commit dcb036d
Showing
2 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
libs/report/committers/src/lib/committer-directory.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { reportCommittersCommand } from './committers'; | ||
import { runCommand } from '@herodevs/utility'; | ||
|
||
jest.mock('@herodevs/utility', () => ({ | ||
runCommand: jest.fn().mockResolvedValue(''), | ||
})); | ||
|
||
describe('reportCommittersCommand directory', () => { | ||
const mockRunCommand = runCommand as jest.Mock; | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('should construct the git command with directory option', async () => { | ||
const args = { | ||
afterDate: '2023-01-01', | ||
beforeDate: '2023-01-31', | ||
exclude: [], | ||
json: false, | ||
directory: 'src', | ||
$0: 'test', | ||
_: [], | ||
}; | ||
|
||
await reportCommittersCommand.handler(args); | ||
|
||
const calledCommand = mockRunCommand.mock.calls[0][0]; | ||
expect(calledCommand).toMatch(/-- src/); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters