Skip to content

Commit

Permalink
test: path patching attempt II
Browse files Browse the repository at this point in the history
  • Loading branch information
toomuchdesign committed Mar 4, 2024
1 parent e98dfd7 commit 8ae58ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/utils/makeRelativePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export function makeRelativePath({
fromDirectory: string;
to: string;
}): string {
return './' + path.relative(fromDirectory, to);
return `.${path.sep}` + path.relative(fromDirectory, to);
}
6 changes: 3 additions & 3 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ describe('openapiToTsJsonSchema', () => {
});

const januarySchema = await import(
path.resolve(outputPath, 'components', 'months', 'January')
path.resolve(outputPath, 'components/months/January')
);
const februarySchema = await import(
path.resolve(outputPath, 'components', 'months', 'February')
path.resolve(outputPath, 'components/months/February')
);

// definition paths get escaped
const path1 = await import(path.resolve(outputPath, 'paths', 'v1_path-1'));
const path1 = await import(path.resolve(outputPath, 'paths/v1_path-1'));

expect(januarySchema.default).toEqual({
description: 'January description',
Expand Down

0 comments on commit 8ae58ca

Please sign in to comment.