import { assert } from "chai" ; import { PathMapper } from "./path-mapper" ; suite ( "PathMapper" , function ( ) { const mappings = { foo : "/one/two/foo" , bar : "/three/four/bar" , } ; const pathMapper = new PathMapper ( mappings ) ; const tests = { "foo -b" : "/one/two/foo -b" , "bar README.md" : "/three/four/bar README.md" , "baz --online" : "baz --online" , } ; const globalizePath = pathMapper . globalizePathFunc ( ) ; for ( const [ give , want ] of Object . entries ( tests ) ) { test ( `makePath "${ give }" --> "${ want }"` , function ( ) { const have = globalizePath ( give ) ; assert . equal ( have , want ) ; } ) ; } } ) ;