@@ -5,17 +5,19 @@ import { run } from '..';
5
5
describe ( `vue-tsc` , ( ) => {
6
6
7
7
it ( `typecheck` , async ( ) => {
8
- const consoleOutput : any [ ] = [ ] ;
8
+ const consoleOutput : string [ ] = [ ] ;
9
9
const originalConsoleLog = process . stdout . write ;
10
10
const originalArgv = process . argv ;
11
11
process . stdout . write = output => {
12
- consoleOutput . push ( output ) ;
12
+ consoleOutput . push ( String ( output ) . trim ( ) ) ;
13
13
return true ;
14
14
} ;
15
15
process . argv = [
16
16
...originalArgv ,
17
17
'--build' ,
18
18
path . resolve ( __dirname , '../../../test-workspace/tsc' ) ,
19
+ '--pretty' ,
20
+ 'false' ,
19
21
] ;
20
22
try {
21
23
run ( ) ;
@@ -24,28 +26,9 @@ describe(`vue-tsc`, () => {
24
26
process . argv = originalArgv ;
25
27
expect ( consoleOutput ) . toMatchInlineSnapshot ( `
26
28
[
27
- "[96mtest-workspace/tsc/failureFixtures/directives/main.vue[0m:[93m4[0m:[93m6[0m - [91merror[0m[90m TS2339: [0mProperty 'notExist' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { exist: typeof exist; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 12 more ..., {}>'.
28
-
29
- [7m4[0m {{ notExist }}
30
- [7m [0m [91m ~~~~~~~~[0m
31
-
32
- ",
33
- "[96mtest-workspace/tsc/failureFixtures/directives/main.vue[0m:[93m9[0m:[93m6[0m - [91merror[0m[90m TS2339: [0mProperty 'notExist' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { exist: typeof exist; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 12 more ..., {}>'.
34
-
35
- [7m9[0m {{ notExist }}
36
- [7m [0m [91m ~~~~~~~~[0m
37
-
38
- ",
39
- "[96mtest-workspace/tsc/failureFixtures/directives/main.vue[0m:[93m12[0m:[93m2[0m - [91merror[0m[90m TS2578: [0mUnused '@ts-expect-error' directive.
40
-
41
- [7m12[0m <!-- @vue-expect-error -->
42
- [7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
43
-
44
- ",
45
- "
46
- Found 3 errors.
47
-
48
- ",
29
+ "test-workspace/tsc/failureFixtures/directives/main.vue(4,6): error TS2339: Property 'notExist' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { exist: typeof exist; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 12 more ..., {}>'.",
30
+ "test-workspace/tsc/failureFixtures/directives/main.vue(9,6): error TS2339: Property 'notExist' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { exist: typeof exist; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 12 more ..., {}>'.",
31
+ "test-workspace/tsc/failureFixtures/directives/main.vue(12,2): error TS2578: Unused '@ts-expect-error' directive.",
49
32
]
50
33
` ) ; ;
51
34
} , 2_000_000 ) ;
0 commit comments