Skip to content

Commit 8b7de3d

Browse files
committed
docs: fix imports in readme and example
1 parent ff6f029 commit 8b7de3d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ If the stub is called with arguments that match `calledWith`, the configured beh
3939

4040
```ts
4141
import { vi, test, afterEach } from 'vitest'
42-
import { when } from ''
42+
import { when } from 'vitest-when'
4343

4444
afterEach(() => {
4545
vi.resetAllMocks()
@@ -122,7 +122,7 @@ See the [./example](./example) directory for example usage.
122122
```ts
123123
// meaning-of-life.test.ts
124124
import { vi, describe, afterEach, it, expect } from 'vitest'
125-
import { when } from '../src/vitest-when.ts'
125+
import { when } from 'vitest-when'
126126

127127
import * as deepThought from './deep-thought.ts'
128128
import * as earth from './earth.ts'

example/meaning-of-life.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { vi, describe, afterEach, it, expect } from 'vitest'
2-
import { when } from '../src/vitest-when.ts'
2+
import { when } from 'vitest-when'
33

44
import * as deepThought from './deep-thought.ts'
55
import * as earth from './earth.ts'

vitest.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { defineConfig } from 'vitest/config'
22

33
export default defineConfig({
4+
resolve: {
5+
alias: {
6+
'vitest-when': './src/vitest-when.ts',
7+
},
8+
},
49
test: {
510
coverage: {
611
provider: 'istanbul',

0 commit comments

Comments
 (0)