From a665fa96eaf69d1c4a2785b0356e9b2d5cc98965 Mon Sep 17 00:00:00 2001 From: Todd Bluhm Date: Fri, 21 Feb 2020 17:25:10 -0600 Subject: [PATCH] test: normalize paths to support windows --- test/utils.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/utils.spec.ts b/test/utils.spec.ts index 31a7bd8..479ad3d 100644 --- a/test/utils.spec.ts +++ b/test/utils.spec.ts @@ -1,5 +1,6 @@ import * as os from 'os' import * as process from 'process' +import * as path from 'path' import { assert } from 'chai' import * as sinon from 'sinon' import { resolveEnvFilePath, parseArgList, isPromise } from '../src/utils' @@ -15,18 +16,18 @@ describe('utils', (): void => { it('should return an absolute path, given a relative path', (): void => { const res = resolveEnvFilePath('./bob') - assert.equal(res, `${currentDir}/bob`) + assert.equal(res, path.normalize(`${currentDir}/bob`)) }) it('should return an absolute path, given a path with ~ for home directory', (): void => { const res = resolveEnvFilePath('~/bob') - assert.equal(res, `${homePath}/bob`) + assert.equal(res, path.normalize(`${homePath}/bob`)) }) it('should not attempt to replace ~ if home dir does not exist', (): void => { sinon.stub(os, 'homedir') const res = resolveEnvFilePath('~/bob') - assert.equal(res, `${currentDir}/~/bob`) + assert.equal(res, path.normalize(`${currentDir}/~/bob`)) }) })