@@ -6,6 +6,10 @@ import { expect } from 'chai';
66import FileLoader from '../src/system/FileLoader' ;
77import NodeFS from '../src/system/NodeFS' ;
88
9+ function normalize ( path : string ) {
10+ return path . replaceAll ( '\\' , '/' ) . replace ( / ^ [ A - Z a - z ] : / , '' ) ;
11+ }
12+
913describe ( 'FileLoader Tests' , ( ) => {
1014 it ( 'Instantiate File Loader' , ( ) => {
1115 const fs = new NodeFS ( ) ;
@@ -29,11 +33,11 @@ describe('FileLoader Tests', () => {
2933 const expected2 = path . join ( import . meta. dirname , 'foo/bar.ts' ) ;
3034 expect ( actual2 ) . to . equal ( expected2 ) ;
3135
32- const actual3 = await loader . absolute ( '/foo/bar' ) ;
36+ const actual3 = normalize ( await loader . absolute ( '/foo/bar' ) ) ;
3337 const expected3 = '/foo/bar' ;
3438 expect ( actual3 ) . to . equal ( expected3 ) ;
3539
36- const actual4 = await loader . absolute ( '/foo/bar.ts' ) ;
40+ const actual4 = normalize ( await loader . absolute ( '/foo/bar.ts' ) ) ;
3741 const expected4 = '/foo/bar.ts' ;
3842 expect ( actual4 ) . to . equal ( expected4 ) ;
3943
@@ -79,7 +83,8 @@ describe('FileLoader Tests', () => {
7983 const loader = new FileLoader ( fs , import . meta. dirname ) ;
8084
8185 const actual = loader . relative ( '/foo/bar/zoo.js' , '/foo/zoo/bar.js' , true ) ;
82- expect ( actual ) . to . equal ( '../zoo/bar.js' )
86+ const normalized = normalize ( actual ) ;
87+ expect ( normalized ) . to . equal ( '../zoo/bar.js' )
8388 } ) ;
8489
8590 it ( 'Should get resolve file/folder' , async ( ) => {
0 commit comments