Skip to content

Commit

Permalink
Fix invalid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Jan 15, 2025
1 parent c3cbfd9 commit a091c0c
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions test/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ describe('Marp CLI', () => {

describe('when CLI is running in an official Docker image', () => {
it('does not output help about --preview option', async () => {
jest.spyOn(container, 'isOfficialDockerImage').mockReturnValue(true)
jest
.spyOn(container, 'isOfficialContainerImage')
.mockReturnValue(true)

expect(await run()).toBe(0)
expect(log).toHaveBeenCalledWith(
Expand All @@ -208,6 +210,28 @@ describe('Marp CLI', () => {
})
})
})

describe('PPTX editable option', () => {
it('outputs help about --pptx-editable option', async () => {
expect(await run()).toBe(0)
expect(log).toHaveBeenCalledWith(
expect.stringContaining('--pptx-editable')
)
})

describe('when CLI is running in an official Docker image', () => {
it('does not output help about --pptx-editable option', async () => {
jest
.spyOn(container, 'isOfficialContainerImage')
.mockReturnValue(true)

expect(await run()).toBe(0)
expect(log).toHaveBeenCalledWith(
expect.not.stringContaining('--pptx-editable')
)
})
})
})
})
}

Expand Down Expand Up @@ -409,7 +433,9 @@ describe('Marp CLI', () => {

describe('when CLI is running in an official Docker image', () => {
it('ignores --preview option with warning', async () => {
jest.spyOn(container, 'isOfficialDockerImage').mockReturnValue(true)
jest
.spyOn(container, 'isOfficialContainerImage')
.mockReturnValue(true)

const warn = jest.spyOn(cli, 'warn').mockImplementation()

Expand Down Expand Up @@ -1423,7 +1449,9 @@ describe('Marp CLI', () => {

describe('when CLI is running in an official Docker image', () => {
it('ignores --preview option with warning', async () => {
jest.spyOn(container, 'isOfficialDockerImage').mockReturnValue(true)
jest
.spyOn(container, 'isOfficialContainerImage')
.mockReturnValue(true)

await marpCli([onePath, '--preview', '--no-output'])

Expand Down

0 comments on commit a091c0c

Please sign in to comment.