Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: tab effect vi.mock * test: tab effect
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable eslint-comments/no-unlimited-disable */ | ||
/* eslint-disable */ | ||
import { expect, test, vi } from 'vitest' | ||
import { join as joinPath } from 'node:path' | ||
|
||
const helloWorld = () => { | ||
return joinPath('hello', 'world') | ||
} | ||
|
||
test('Are you mocking me?', () => { | ||
// note there are NO indents in this file | ||
// except the next line | ||
// test pass with spaces, test fails with tab | ||
vi.mock('node:path', () => { | ||
return { | ||
join: vi.fn().mockReturnValue('goodbye world') | ||
} | ||
}) | ||
expect(helloWorld()).toBe('goodbye world') | ||
}) |