Skip to content

Commit 7f3cab1

Browse files
authored
test: type check tests when running them (#158)
1 parent c2d8233 commit 7f3cab1

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"prepublishOnly": "npx yarn build",
1919
"prettier:check": "prettier --list-different \"src/**/*.{ts,tsx}\"",
2020
"prettier:write": "prettier --write \"src/**/*.{ts,tsx}\"",
21-
"test": "vitest run",
21+
"test": "tsc --noEmit -p tests && vitest run",
2222
"prepare": "husky"
2323
},
2424
"bin": {

tests/block-parsers.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import MarkdownIt from 'markdown-it';
22
import { describe, expect, it } from 'vitest';
33

4-
import { parseMethodBlocks } from '../src/block-parsers';
4+
import { parseMethodBlocks } from '../src/block-parsers.js';
55

66
describe('block parsers', () => {
77
it('should parse a method', async () => {

tests/helpers.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { extendError } from '../src/helpers';
1+
import { extendError } from '../src/helpers.js';
22

33
import chalk from 'chalk';
44
import { describe, expect, it } from 'vitest';

tests/markdown-helpers.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515
consumeTypedKeysList,
1616
findProcess,
1717
slugifyHeading,
18-
} from '../src/markdown-helpers';
19-
import { DocumentationTag } from '../src/ParsedDocumentation';
18+
} from '../src/markdown-helpers.js';
19+
import { DocumentationTag } from '../src/ParsedDocumentation.js';
2020

2121
const getTokens = (md: string) => {
2222
const markdown = new MarkdownIt({ html: true });

tests/tsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"incremental": false,
5+
"noEmit": true,
6+
"rootDir": ".."
7+
},
8+
"include": [
9+
"."
10+
]
11+
}

0 commit comments

Comments
 (0)