From 1a3b295b8715a6edfe21fbf9b34024af94c77d69 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 21 Nov 2018 10:46:50 +0900 Subject: [PATCH 1/2] Remove @ts-ignore magic comments from test code --- test/converter.ts | 3 +-- test/engine.ts | 3 +-- test/marp-cli.ts | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/converter.ts b/test/converter.ts index 5ca07dfe..fbe88021 100644 --- a/test/converter.ts +++ b/test/converter.ts @@ -199,8 +199,7 @@ describe('Converter', () => { it('converts into PDF by using temporally file', async () => { const file = new File(onePath) - // @ts-ignore to check cleanup tmpfile - const fileCleanup = jest.spyOn(File.prototype, 'cleanup') + const fileCleanup = jest.spyOn(File.prototype, 'cleanup') const fileSave = jest .spyOn(File.prototype, 'save') .mockImplementation() diff --git a/test/engine.ts b/test/engine.ts index 4556fc6d..563ab188 100644 --- a/test/engine.ts +++ b/test/engine.ts @@ -17,8 +17,7 @@ describe('Engine', () => { }) it("loads browser script from defined in module's marpBrowser section", async () => { - // @ts-ignore: #findClassPath is mocked - const finder = ResolvedEngine.prototype.findClassPath + const finder = (ResolvedEngine.prototype).findClassPath // Core (defined marpBrowser) finder.mockImplementation(() => require.resolve(coreModule)) diff --git a/test/marp-cli.ts b/test/marp-cli.ts index a8ad88cc..e08e4581 100644 --- a/test/marp-cli.ts +++ b/test/marp-cli.ts @@ -530,8 +530,8 @@ describe('Marp CLI', () => { .spyOn(getStdin, 'buffer') .mockResolvedValue(Buffer.from('# markdown')) - // @ts-ignore: reset cached stdin buffer - File.stdinBuffer = undefined + // reset cached stdin buffer + ;(File).stdinBuffer = undefined expect(await marpCli()).toBe(0) expect(cliInfo).toHaveBeenCalledWith( From a05ca5f600ba437a130bc6a99ff322865ada157f Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Wed, 21 Nov 2018 16:47:52 +0900 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 341c8206..64f79b60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Fixed - Use `Buffer.from()` instead of deprecated constructor ([#37](https://github.com/marp-team/marp-cli/pull/37)) +- Remove `@ts-ignore` magic comment from test ([#39](https://github.com/marp-team/marp-cli/pull/39)) ## v0.0.13 - 2018-11-10