Skip to content

Commit af73d30

Browse files
committed
update
1 parent 4482f6d commit af73d30

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/tsc/tests/typecheck.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import { expect, test } from 'vitest';
55
import { run } from '..';
66

77
test(`vue-tsc`, () => {
8-
const tests = fs.readdirSync(path.resolve(__dirname, '../../../test-workspace/tsc'))
9-
.filter(dir => dir !== 'tsconfig.json' && dir !== 'shared.d.ts' && dir !== 'petite-vue');
8+
const dirPath = path.resolve(__dirname, '..', '..', '..', 'test-workspace', 'tsc');
9+
const tests = fs.readdirSync(dirPath)
10+
.filter(dir => fs.existsSync(path.resolve(dirPath, dir, 'tsconfig.json')));
11+
1012
fs.writeFileSync(
1113
path.resolve(__dirname, '../../../test-workspace/tsc/tsconfig.json'),
1214
JSON.stringify(
@@ -18,11 +20,11 @@ test(`vue-tsc`, () => {
1820
'\t',
1921
),
2022
);
23+
2124
expect(
2225
getTscOutput().sort(),
2326
).toMatchInlineSnapshot(`
2427
[
25-
"test-workspace/tsc/components_3.4/main.vue(79,11): error TS2345: Argument of type '<T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<...>) => import("vue3.4").VNode & { __ctx?: Awaite...' is not assignable to parameter of type 'never'.",
2628
"test-workspace/tsc/failed_#3632/both.vue(3,1): error TS1109: Expression expected.",
2729
"test-workspace/tsc/failed_#3632/both.vue(7,1): error TS1109: Expression expected.",
2830
"test-workspace/tsc/failed_#3632/script.vue(3,1): error TS1109: Expression expected.",

test-workspace/tsc/components_3.4/main.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ declare const ScriptSetupGenericExact: <T, >(
6464
props: {
6565
onBar?: ((data: T) => any) | undefined;
6666
foo: T;
67-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Record<string, unknown>,
67+
} & import('vue3.4').VNodeProps & import('vue3.4').AllowedComponentProps & import('vue3.4').ComponentCustomProps & Record<string, unknown>,
6868
attrs: any,
6969
slots: { default?: (props: T) => any; },
7070
emit: { (e: 'bar', data: T): void; },
71-
expose(_exposed: import('vue').ShallowUnwrapRef<{ baz: T; buz: import('vue').Ref<1>; }>): void,
71+
expose(_exposed: import('vue3.4').ShallowUnwrapRef<{ baz: T; buz: import('vue3.4').Ref<1>; }>): void,
7272
}>
73-
) => import('vue').VNode & { __ctx?: Awaited<typeof _setup>; };
73+
) => import('vue3.4').VNode & { __ctx?: Awaited<typeof _setup>; };
7474
7575
exactType(ScriptSetup, ScriptSetupExact);
7676
exactType(ScriptSetupExpose, ScriptSetupExposeExact);

0 commit comments

Comments
 (0)