From 82004eebb70e08b7ee191284b788c51ac6d823ee Mon Sep 17 00:00:00 2001 From: segersniels Date: Wed, 14 Jun 2023 10:32:59 +0200 Subject: [PATCH] :recycle: Refactor into typescript test --- test/__snapshots__/{cli.spec.js.snap => cli.spec.ts.snap} | 0 test/{cli.spec.js => cli.spec.ts} | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) rename test/__snapshots__/{cli.spec.js.snap => cli.spec.ts.snap} (100%) rename test/{cli.spec.js => cli.spec.ts} (87%) diff --git a/test/__snapshots__/cli.spec.js.snap b/test/__snapshots__/cli.spec.ts.snap similarity index 100% rename from test/__snapshots__/cli.spec.js.snap rename to test/__snapshots__/cli.spec.ts.snap diff --git a/test/cli.spec.js b/test/cli.spec.ts similarity index 87% rename from test/cli.spec.js rename to test/cli.spec.ts index 66016d1102..55d91a1a12 100644 --- a/test/cli.spec.js +++ b/test/cli.spec.ts @@ -1,5 +1,6 @@ import updateNotifier from 'update-notifier' import meow from 'meow' +import { describe, expect, it, jest } from '@jest/globals' import pkg from '../package.json' import { options } from '../src/cli' @@ -16,9 +17,11 @@ describe('cli', () => { }) it('should match meow with cli information', () => { - meow.mock.calls[0][1].importMeta = 'import.meta.url' + ( + (meow as jest.Mock).mock.calls[0][1] as { importMeta: string } + ).importMeta = 'import.meta.url' - expect(meow.mock.calls).toMatchSnapshot() + expect((meow as jest.Mock).mock.calls).toMatchSnapshot() }) it('should call commit command on commit', () => {