From 0e95cc81149da9b3eebbf0c6fe948e1252db2c1a Mon Sep 17 00:00:00 2001 From: snowingfox <1503401882@qq.com> Date: Wed, 27 Apr 2022 22:02:56 +0800 Subject: [PATCH] chore: correct typo (#1199) --- packages/vitest/src/index.ts | 2 +- packages/vitest/src/integrations/chai/jest-expect.ts | 6 +++--- packages/vitest/src/integrations/coverage.ts | 2 +- test/core/test/date-mock.test.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/vitest/src/index.ts b/packages/vitest/src/index.ts index d2103d019620..c64c5e83b734 100644 --- a/packages/vitest/src/index.ts +++ b/packages/vitest/src/index.ts @@ -124,7 +124,7 @@ declare global { } // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error - // @ts-ignore build namspace conflict + // @ts-ignore build namespace conflict type VitestAssertion = { [K in keyof A]: A[K] extends Chai.Assertion ? Assertion diff --git a/packages/vitest/src/integrations/chai/jest-expect.ts b/packages/vitest/src/integrations/chai/jest-expect.ts index 187dac88a8df..0cad69e136b7 100644 --- a/packages/vitest/src/integrations/chai/jest-expect.ts +++ b/packages/vitest/src/integrations/chai/jest-expect.ts @@ -489,13 +489,13 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => { def(['toHaveReturnedTimes', 'toReturnTimes'], function (times: number) { const spy = getSpy(this) const spyName = spy.getMockName() - const successfullReturns = spy.mock.results.reduce((success, { type }) => type === 'throw' ? success : ++success, 0) + const successfulReturns = spy.mock.results.reduce((success, { type }) => type === 'throw' ? success : ++success, 0) this.assert( - successfullReturns === times, + successfulReturns === times, `expected "${spyName}" to be successfully called ${times} times`, `expected "${spyName}" to not be successfully called ${times} times`, `expected number of returns: ${times}`, - `received number of returns: ${successfullReturns}`, + `received number of returns: ${successfulReturns}`, ) }) def(['toHaveReturnedWith', 'toReturnWith'], function (value: any) { diff --git a/packages/vitest/src/integrations/coverage.ts b/packages/vitest/src/integrations/coverage.ts index 57cf3421aceb..dbdcead66a43 100644 --- a/packages/vitest/src/integrations/coverage.ts +++ b/packages/vitest/src/integrations/coverage.ts @@ -82,7 +82,7 @@ export async function reportCoverage(ctx: Vitest) { // This is a magic number. It corresponds to the amount of code // that we add in packages/vite-node/src/client.ts:114 (vm.runInThisContext) - // TODO: Include our transformations in soucemaps + // TODO: Include our transformations in sourcemaps const offset = 203 report._getSourceMap = (coverage: Profiler.ScriptCoverage) => { diff --git a/test/core/test/date-mock.test.ts b/test/core/test/date-mock.test.ts index 35ed4abf1196..eb0fb17b8915 100644 --- a/test/core/test/date-mock.test.ts +++ b/test/core/test/date-mock.test.ts @@ -5,7 +5,7 @@ describe('testing date mock functionality', () => { vi.useRealTimers() }) - test('seting time in the past', () => { + test('setting time in the past', () => { const date = new Date(2000, 1, 1) vi.setSystemTime(date)