Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mts coverage #2492

Merged
merged 8 commits into from Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vitest/src/defaults.ts
Expand Up @@ -36,7 +36,7 @@ const coverageConfigDefaults = {
allowExternal: false,
// default extensions used by c8, plus '.vue' and '.svelte'
// see https://github.com/istanbuljs/schema/blob/master/default-extension.js
extension: ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue', '.svelte'],
extension: ['.js', '.cjs', '.mjs', '.ts', '.mts', '.cts', '.tsx', '.jsx', '.vue', '.svelte'],
} as ResolvedCoverageOptions

export const fakeTimersDefaults = {
Expand Down
Expand Up @@ -1426,7 +1426,7 @@ exports[`c8 json report 1`] = `
},
},
},
"<process-cwd>/src/index.ts": {
"<process-cwd>/src/index.mts": {
"all": false,
"b": {
"0": [
Expand Down Expand Up @@ -1544,7 +1544,7 @@ exports[`c8 json report 1`] = `
"name": "get",
},
},
"path": "<process-cwd>/src/index.ts",
"path": "<process-cwd>/src/index.mts",
"s": {
"0": 1,
"1": 1,
Expand Down
Expand Up @@ -413,7 +413,7 @@ exports[`istanbul json report 1`] = `
"<process-cwd>/src/implicitElse.ts": {
"b": {
"0": [
1,
2,
0,
],
},
Expand Down Expand Up @@ -455,7 +455,7 @@ exports[`istanbul json report 1`] = `
},
},
"f": {
"0": 1,
"0": 2,
},
"fnMap": {
"0": {
Expand Down Expand Up @@ -484,10 +484,10 @@ exports[`istanbul json report 1`] = `
},
"path": "<process-cwd>/src/implicitElse.ts",
"s": {
"0": 1,
"1": 1,
"2": 1,
"3": 1,
"0": 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right. Did you rebuild after rebase?
This is what #2466 fixed.

"1": 2,
"2": 2,
"3": 2,
},
"statementMap": {
"0": {
Expand Down Expand Up @@ -536,7 +536,7 @@ exports[`istanbul json report 1`] = `
"b": {},
"branchMap": {},
"f": {
"0": 1,
"0": 2,
},
"fnMap": {
"0": {
Expand Down Expand Up @@ -565,7 +565,7 @@ exports[`istanbul json report 1`] = `
},
"path": "<process-cwd>/src/importEnv.ts",
"s": {
"0": 1,
"0": 2,
},
"statementMap": {
"0": {
Expand All @@ -580,11 +580,11 @@ exports[`istanbul json report 1`] = `
},
},
},
"<process-cwd>/src/index.ts": {
"<process-cwd>/src/index.mts": {
"b": {},
"branchMap": {},
"f": {
"0": 1,
"0": 2,
},
"fnMap": {
"0": {
Expand All @@ -611,9 +611,9 @@ exports[`istanbul json report 1`] = `
"name": "pythagoras",
},
},
"path": "<process-cwd>/src/index.ts",
"path": "<process-cwd>/src/index.mts",
"s": {
"0": 1,
"0": 2,
},
"statementMap": {
"0": {
Expand Down Expand Up @@ -909,7 +909,7 @@ exports[`istanbul json report 1`] = `
"b": {
"0": [
0,
1,
2,
],
},
"branchMap": {
Expand Down Expand Up @@ -950,10 +950,10 @@ exports[`istanbul json report 1`] = `
},
},
"f": {
"0": 1,
"1": 2,
"0": 2,
"1": 4,
"2": 0,
"3": 1,
"3": 2,
"4": 0,
},
"fnMap": {
Expand Down Expand Up @@ -1075,12 +1075,12 @@ exports[`istanbul json report 1`] = `
},
"path": "<process-cwd>/src/utils.ts",
"s": {
"0": 1,
"1": 2,
"0": 2,
"1": 4,
"2": 0,
"3": 1,
"3": 2,
"4": 0,
"5": 1,
"5": 2,
"6": 0,
},
"statementMap": {
Expand Down
Expand Up @@ -11,7 +11,7 @@ test('html report', async () => {
const files = fs.readdirSync(coveragePath)

expect(files).toContain('index.html')
expect(files).toContain('index.ts.html')
expect(files).toContain('index.mts.html')
expect(files).toContain('Hello.vue.html')
})

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/coverage-test/test/coverage.test.ts
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest'
import { pythagoras } from '../src'
import { pythagoras } from '../src/index.mjs'
poyoho marked this conversation as resolved.
Show resolved Hide resolved
import { implicitElse } from '../src/implicitElse'
import { useImportEnv } from '../src/importEnv'

Expand Down