Skip to content

Commit f69a568

Browse files
committed
disable TTY
1 parent 9bba208 commit f69a568

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

packages/tsc/tests/typecheck.spec.ts

+7-24
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ import { run } from '..';
55
describe(`vue-tsc`, () => {
66

77
it(`typecheck`, async () => {
8-
const consoleOutput: any[] = [];
8+
const consoleOutput: string[] = [];
99
const originalConsoleLog = process.stdout.write;
1010
const originalArgv = process.argv;
1111
process.stdout.write = output => {
12-
consoleOutput.push(output);
12+
consoleOutput.push(String(output).trim());
1313
return true;
1414
};
1515
process.argv = [
1616
...originalArgv,
1717
'--build',
1818
path.resolve(__dirname, '../../../test-workspace/tsc'),
19+
'--pretty',
20+
'false',
1921
];
2022
try {
2123
run();
@@ -24,28 +26,9 @@ describe(`vue-tsc`, () => {
2426
process.argv = originalArgv;
2527
expect(consoleOutput).toMatchInlineSnapshot(`
2628
[
27-
"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 ..., {}>'.
28-
29-
4 {{ notExist }}
30-
   ~~~~~~~~
31-
32-
",
33-
"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 ..., {}>'.
34-
35-
9 {{ notExist }}
36-
   ~~~~~~~~
37-
38-
",
39-
"test-workspace/tsc/failureFixtures/directives/main.vue:12:2 - error TS2578: Unused '@ts-expect-error' directive.
40-
41-
12 <!-- @vue-expect-error -->
42-
   ~~~~~~~~~~~~~~~~~~~~~~~~~~
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.",
4932
]
5033
`);;
5134
}, 2_000_000);

0 commit comments

Comments
 (0)