-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfac928
commit 3974b83
Showing
7 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
31 changes: 31 additions & 0 deletions
31
test/workspaces/space-multi-transform/src/multi-transform.ts
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,31 @@ | ||
/** | ||
* The variable below is modified by custom Vite plugin | ||
*/ | ||
export const padding = 'default-padding' | ||
|
||
export function run(name: string) { | ||
/* | ||
* These if-branches should show correctly on coverage report. | ||
* Otherwise source maps are off. | ||
*/ | ||
if (name === 'not-covered') { | ||
// This is not covered by any test | ||
return 0 | ||
} | ||
// Comment | ||
else if (name === 'project-1') { | ||
// This is covered by Project #1 | ||
return 1 | ||
} | ||
else if (name === 'not-covered-2') { | ||
// This is not covered by any test | ||
return 0 | ||
} | ||
else if (name === 'project-2') { | ||
// This is covered by Project #2 | ||
return 2 | ||
} | ||
|
||
// This is covered by both projects, should show 2x hits | ||
return 3 | ||
} |
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,9 @@ | ||
import { expect, test } from 'vitest' | ||
|
||
import { run } from '../src/multi-transform' | ||
|
||
test('cover some branches', () => { | ||
expect(run('project-1')).toBe(1) | ||
|
||
expect(run('last branch')).toBe(3) | ||
}) |
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,9 @@ | ||
import { expect, test } from 'vitest' | ||
|
||
import { run } from '../src/multi-transform' | ||
|
||
test('cover some branches', () => { | ||
expect(run('project-2')).toBe(2) | ||
|
||
expect(run('last branch')).toBe(3) | ||
}) |
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