Skip to content

Commit

Permalink
chore: enhance unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
w2xi committed Jan 15, 2025
1 parent 075fb6f commit f1fb9ff
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/handleOptions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import { handleOptions } from '../src/handleOptions'

describe('handleOptions', () => {
const defaultOptions = {
directory: process.cwd()
directory: process.cwd(),
}
test('ignore', () => {
const options = handleOptions({
...defaultOptions,
ignore: '.git,node_modules'
ignore: '.git,node_modules',
})
expect(options.ignore).toEqual(['.git', 'node_modules'])
})

test('layer', () => {
const options = handleOptions({
...defaultOptions,
layer: 1
layer: 1,
})
expect(options.layer).toBe(1)
})
Expand All @@ -29,7 +29,7 @@ describe('handleOptions', () => {
test('onlyFolder', () => {
const options = handleOptions({
...defaultOptions,
onlyFolder: true
onlyFolder: true,
})
expect(options.onlyFolder).toBe(true)
})
Expand All @@ -42,8 +42,16 @@ describe('handleOptions', () => {
test('output', () => {
const options = handleOptions({
...defaultOptions,
output: 'test.md'
output: 'test.md',
})
expect(options.output).toBe('test.md')
})

test('clipboard', () => {
const options = handleOptions({
...defaultOptions,
clipboard: true,
})
expect(options.clipboard).toBe(true)
})
})

0 comments on commit f1fb9ff

Please sign in to comment.