Skip to content

Commit 799f9a1

Browse files
poyohoAriPerkkio
andauthoredDec 13, 2022
feat: add mts, cts files to coverage (#2492)
* feat: mts coverage * test: fix * fix: snapslot * docs: coverage * fix: snapslot * chore: update Co-authored-by: Ari Perkkiö <ari.perkkio@gmail.com> * chore: reset Co-authored-by: Ari Perkkiö <ari.perkkio@gmail.com>
1 parent affb9ea commit 799f9a1

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed
 

Diff for: ‎docs/config/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ List of files included in coverage as glob patterns
534534
#### extension
535535

536536
- **Type:** `string | string[]`
537-
- **Default:** `['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue', '.svelte']`
537+
- **Default:** `['.js', '.cjs', '.mjs', '.ts', '.mts', '.cts', '.tsx', '.jsx', '.vue', '.svelte']`
538538
- **Available for providers:** `'c8' | 'istanbul'`
539539

540540
#### exclude

Diff for: ‎packages/vitest/src/defaults.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const coverageConfigDefaults = {
3636
allowExternal: false,
3737
// default extensions used by c8, plus '.vue' and '.svelte'
3838
// see https://github.com/istanbuljs/schema/blob/master/default-extension.js
39-
extension: ['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx', '.vue', '.svelte'],
39+
extension: ['.js', '.cjs', '.mjs', '.ts', '.mts', '.cts', '.tsx', '.jsx', '.vue', '.svelte'],
4040
} as ResolvedCoverageOptions
4141

4242
export const fakeTimersDefaults = {

Diff for: ‎test/coverage-test/coverage-report-tests/__snapshots__/c8.report.test.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ exports[`c8 json report 1`] = `
14261426
},
14271427
},
14281428
},
1429-
"<process-cwd>/src/index.ts": {
1429+
"<process-cwd>/src/index.mts": {
14301430
"all": false,
14311431
"b": {
14321432
"0": [
@@ -1544,7 +1544,7 @@ exports[`c8 json report 1`] = `
15441544
"name": "get",
15451545
},
15461546
},
1547-
"path": "<process-cwd>/src/index.ts",
1547+
"path": "<process-cwd>/src/index.mts",
15481548
"s": {
15491549
"0": 1,
15501550
"1": 1,

Diff for: ‎test/coverage-test/coverage-report-tests/__snapshots__/istanbul.report.test.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ exports[`istanbul json report 1`] = `
580580
},
581581
},
582582
},
583-
"<process-cwd>/src/index.ts": {
583+
"<process-cwd>/src/index.mts": {
584584
"b": {},
585585
"branchMap": {},
586586
"f": {
@@ -611,7 +611,7 @@ exports[`istanbul json report 1`] = `
611611
"name": "pythagoras",
612612
},
613613
},
614-
"path": "<process-cwd>/src/index.ts",
614+
"path": "<process-cwd>/src/index.mts",
615615
"s": {
616616
"0": 1,
617617
},

Diff for: ‎test/coverage-test/coverage-report-tests/generic.report.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('html report', async () => {
1111
const files = fs.readdirSync(coveragePath)
1212

1313
expect(files).toContain('index.html')
14-
expect(files).toContain('index.ts.html')
14+
expect(files).toContain('index.mts.html')
1515
expect(files).toContain('Hello.vue.html')
1616
})
1717

File renamed without changes.

Diff for: ‎test/coverage-test/test/coverage.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest'
2-
import { pythagoras } from '../src'
2+
import { pythagoras } from '../src/index.mjs'
33
import { implicitElse } from '../src/implicitElse'
44
import { useImportEnv } from '../src/importEnv'
55

0 commit comments

Comments
 (0)
Please sign in to comment.