Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Sep 8, 2023
1 parent b864104 commit 1c44513
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vue-tsc/tests/__snapshots__/dts.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`vue-tsc-dts > Input: base\\main.vue, Output: base\\main.vue.d.ts 1`] = `
exports[`vue-tsc-dts > Input: basic/main.vue, Output: basic/main.vue.d.ts 1`] = `
"declare const _default: import(\\"vue\\").DefineComponent<{
name: {
type: import(\\"vue\\").PropType<string>;
Expand Down
3 changes: 2 additions & 1 deletion packages/vue-tsc/tests/dts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createProgram } from '../src';
const workspace = path.resolve(__dirname, '../../vue-test-workspace/vue-tsc-dts');
const testDirs = fs.readdirSync(workspace);
const ensureTs = (filename: string) => filename.endsWith('.ts') ? filename : filename + '.ts';
const normalizePath = (filename: string) => filename.replace(/\\/g, '/');

const compilerOptions: ts.CompilerOptions = {
rootDir: workspace,
Expand All @@ -28,7 +29,7 @@ describe('vue-tsc-dts', () => {
for (const file of files) {
const output = service.getEmitOutput(ensureTs(file), true);
for (const outputFile of output.outputFiles) {
it(`Input: ${path.join(dirName, path.basename(file))}, Output: ${path.join(dirName, path.basename(outputFile.name))}`, () => {
it(`Input: ${normalizePath(path.join(dirName, path.basename(file)))}, Output: ${normalizePath(path.join(dirName, path.basename(outputFile.name)))}`, () => {
expect(outputFile.text).toMatchSnapshot();
});
}
Expand Down

0 comments on commit 1c44513

Please sign in to comment.