From 3bfc58c0f07c0c1fec8fc39740f97fc841c11836 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Sun, 21 Aug 2022 09:17:41 -0400 Subject: [PATCH] Fix `resolveRelative` utility to work on Windows --- src/util/resolveRelative.ts | 4 ++-- test/dependencies-test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/resolveRelative.ts b/src/util/resolveRelative.ts index e7244cc..7e8a2f6 100644 --- a/src/util/resolveRelative.ts +++ b/src/util/resolveRelative.ts @@ -1,4 +1,4 @@ -import * as path from 'path'; +import { posix as path } from 'path'; const PARENT_DIR = '..' + path.sep; @@ -30,4 +30,4 @@ export default function resolveRelative(relativePath: string, ...otherPaths: Arr } } return cumulativePath; -} \ No newline at end of file +} diff --git a/test/dependencies-test.js b/test/dependencies-test.js index b228f08..db3f402 100644 --- a/test/dependencies-test.js +++ b/test/dependencies-test.js @@ -44,7 +44,7 @@ function touch(filePath, contents) { } } -describe('relativePath utility', function() { +describe('resolveRelative utility', function() { it('resolves a relative path', function() { assert.equal(resolveRelative('.', 'foo.txt'), 'foo.txt'); });