Skip to content

Commit

Permalink
chore: rename things
Browse files Browse the repository at this point in the history
  • Loading branch information
pkerschbaum committed Sep 15, 2024
1 parent 6bd7afc commit 66a1599
Show file tree
Hide file tree
Showing 18 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { test, expect } from 'vitest';
import { loadTypeScriptProgram } from '#pkg/load-typescript-program.js';
import { rewriteModuleSpecifiersOfTypeScriptProject } from '#pkg/transform/index.js';

const PATH_TO_TRANSFORMER_INPUTS = path.join(__dirname, 'transformer-inputs');
const PATH_TO_CODEMOD_INPUTS = path.join(__dirname, 'codemod-inputs');
const PATH_TO_CODEMOD_OUTPUTS = path.join(__dirname, 'codemod-outputs');

test('project-1', async () => {
const projectAbsolutePath = path.join(PATH_TO_TRANSFORMER_INPUTS, 'project-1', 'tsconfig.json');
const projectAbsolutePath = path.join(PATH_TO_CODEMOD_INPUTS, 'project-1', 'tsconfig.json');
const basepath = path.dirname(projectAbsolutePath);

const typeScriptProgram = await loadTypeScriptProgram({ project: projectAbsolutePath, basepath });
Expand All @@ -23,14 +24,14 @@ test('project-1', async () => {
);
const relativePathFromRootDir = path.relative(basepath, absolutePathSourceFile);
await expect(newText).toMatchFileSnapshot(
`./transformer-outputs/project-1/${relativePathFromRootDir}`,
path.join(PATH_TO_CODEMOD_OUTPUTS, 'project-1', relativePathFromRootDir),
);
}),
);
});

test('project-2', async () => {
const projectAbsolutePath = path.join(PATH_TO_TRANSFORMER_INPUTS, 'project-2', 'tsconfig.json');
const projectAbsolutePath = path.join(PATH_TO_CODEMOD_INPUTS, 'project-2', 'tsconfig.json');
const basepath = path.dirname(projectAbsolutePath);

const typeScriptProgram = await loadTypeScriptProgram({ project: projectAbsolutePath, basepath });
Expand All @@ -45,7 +46,7 @@ test('project-2', async () => {
);
const relativePathFromRootDir = path.relative(basepath, absolutePathSourceFile);
await expect(newText).toMatchFileSnapshot(
`./transformer-outputs/project-2/${relativePathFromRootDir}`,
path.join(PATH_TO_CODEMOD_OUTPUTS, 'project-2', relativePathFromRootDir),
);
}),
);
Expand Down

0 comments on commit 66a1599

Please sign in to comment.