Skip to content

Commit

Permalink
Add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Jan 16, 2022
1 parent 03cab78 commit 56ce20e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,11 @@ describe('Marp CLI', () => {
expect((await conversion(...cmd)).options.type).toBe(ConvertType.png)
})

it('converts file with PNG type if the type was not specified', async () => {
const cmd = [onePath, '--image']
expect((await conversion(...cmd)).options.type).toBe(ConvertType.png)
})

it('converts file with JPEG type by specified jpeg', async () => {
const cmd = [onePath, '--image=jpeg']
expect((await conversion(...cmd)).options.type).toBe(ConvertType.jpeg)
Expand All @@ -633,6 +638,12 @@ describe('Marp CLI', () => {
expect(converter.options.pages).toBe(true)
})

it('converts file with PNG type if the type was not specified', async () => {
const converter = await conversion(onePath, '--images')
expect(converter.options.type).toBe(ConvertType.png)
expect(converter.options.pages).toBe(true)
})

it('converts file with JPEG type and enabled pages option by specified jpeg', async () => {
const converter = await conversion(onePath, '--images=jpeg')
expect(converter.options.type).toBe(ConvertType.jpeg)
Expand Down

0 comments on commit 56ce20e

Please sign in to comment.