Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andriyor committed Jan 21, 2024
1 parent a56a8ea commit 22337cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const getProjectFilesByPath = (projectPath: string) => {
withFileTypes: true,
})
.filter((path) => !path.isDirectory())
.map((filePath) => path.relative(process.cwd(), filePath.fullpath()));
.map((filePath) => filePath.fullpath());
};

export const prepareTestCases = () => {
const testProjectFiles = getProjectFilesByPath(path.join(process.cwd(), 'test/test-project'));
const testProjectFilesExpected = getProjectFilesByPath(path.join(process.cwd(),
'test/test-project-expected'
const testProjectFiles = getProjectFilesByPath(path.join(__dirname, 'test-project'));
const testProjectFilesExpected = getProjectFilesByPath(path.join(__dirname,
'test-project-expected'
));
return zip([testProjectFiles, testProjectFilesExpected]);
};
3 changes: 2 additions & 1 deletion test/test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import { beforeAll, describe, it, expect, afterAll } from 'vitest'

import { migrateToNamedExport } from '../src';
import { prepareTestCases } from './helper';
import path from 'path';

const exec = util.promisify(childProcess.exec);

beforeAll(async () => {
await migrateToNamedExport({
projectFiles: 'test/test-project/**/*.{tsx,ts}'
projectFiles: path.join(__dirname, 'test-project/**/*.{tsx,ts}')
});
});

Expand Down

0 comments on commit 22337cc

Please sign in to comment.