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',