From 8b7de3dc5aa995610864396916bec11284fef154 Mon Sep 17 00:00:00 2001 From: Michael Cousins Date: Sat, 14 Oct 2023 15:38:38 -0400 Subject: [PATCH] docs: fix imports in readme and example --- README.md | 4 ++-- example/meaning-of-life.test.ts | 2 +- vitest.config.ts | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59a8747..4280b3a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ If the stub is called with arguments that match `calledWith`, the configured beh ```ts import { vi, test, afterEach } from 'vitest' -import { when } from '' +import { when } from 'vitest-when' afterEach(() => { vi.resetAllMocks() @@ -122,7 +122,7 @@ See the [./example](./example) directory for example usage. ```ts // meaning-of-life.test.ts import { vi, describe, afterEach, it, expect } from 'vitest' -import { when } from '../src/vitest-when.ts' +import { when } from 'vitest-when' import * as deepThought from './deep-thought.ts' import * as earth from './earth.ts' diff --git a/example/meaning-of-life.test.ts b/example/meaning-of-life.test.ts index 328e0a0..1a65d5c 100644 --- a/example/meaning-of-life.test.ts +++ b/example/meaning-of-life.test.ts @@ -1,5 +1,5 @@ import { vi, describe, afterEach, it, expect } from 'vitest' -import { when } from '../src/vitest-when.ts' +import { when } from 'vitest-when' import * as deepThought from './deep-thought.ts' import * as earth from './earth.ts' diff --git a/vitest.config.ts b/vitest.config.ts index 1f51f9f..c99a75d 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,6 +1,11 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ + resolve: { + alias: { + 'vitest-when': './src/vitest-when.ts', + }, + }, test: { coverage: { provider: 'istanbul',