From 30cb16c47394b9e8aa0dd7830fecf274163d7533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Sat, 16 Sep 2023 19:39:33 +0200 Subject: [PATCH] correct win tests again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- packages/config-loader/src/loader.test.ts | 7 +++++-- packages/config-loader/src/sources/ConfigSources.test.ts | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/config-loader/src/loader.test.ts b/packages/config-loader/src/loader.test.ts index c9443f8d85..ff6d5b2551 100644 --- a/packages/config-loader/src/loader.test.ts +++ b/packages/config-loader/src/loader.test.ts @@ -20,6 +20,9 @@ import mockFs from 'mock-fs'; import fs from 'fs-extra'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; +import { resolve as resolvePath, sep } from 'path'; + +const root = resolvePath('/'); describe('loadConfig', () => { const server = setupServer(); @@ -132,7 +135,7 @@ describe('loadConfig', () => { escaped: '${Escaped}', }, }, - path: '/root/app-config.yaml', + path: `${root}root${sep}app-config.yaml`, }, ], }); @@ -318,7 +321,7 @@ describe('loadConfig', () => { escaped: '${Escaped}', }, }, - path: '/root/app-config.yaml', + path: `${root}root${sep}app-config.yaml`, }, ], }); diff --git a/packages/config-loader/src/sources/ConfigSources.test.ts b/packages/config-loader/src/sources/ConfigSources.test.ts index cbdb405cb6..9a02b684ab 100644 --- a/packages/config-loader/src/sources/ConfigSources.test.ts +++ b/packages/config-loader/src/sources/ConfigSources.test.ts @@ -93,7 +93,7 @@ describe('ConfigSources', () => { targets: [{ type: 'path', target: '/config.yaml' }], }), ), - ).toEqual([{ name: 'FileConfigSource', path: `${root}config.yaml` }]); + ).toEqual([{ name: 'FileConfigSource', path: '/config.yaml' }]); const subFunc = async () => undefined; expect( @@ -193,9 +193,9 @@ describe('ConfigSources', () => { ]), ), ).toEqual([ - { name: 'FileConfigSource', path: `${root}a.yaml` }, - { name: 'FileConfigSource', path: `${root}b.yaml` }, - { name: 'FileConfigSource', path: `${root}c.yaml` }, + { name: 'FileConfigSource', path: '/a.yaml' }, + { name: 'FileConfigSource', path: '/b.yaml' }, + { name: 'FileConfigSource', path: '/c.yaml' }, ]); });