@@ -4,7 +4,6 @@ import { ImportMap } from "@jspm/import-map";
44
55import {
66 constructPath ,
7- constructUrlPath ,
87 constructImportMap ,
98 createCacheMap ,
109 parseNodeModuleCachePath ,
@@ -36,7 +35,7 @@ jest.mock("@jspm/import-map", () => {
3635} ) ;
3736
3837test ( "constructPath minimal" , ( ) => {
39- const result = constructPath ( "foo" ) ;
38+ const result = constructPath ( "foo" , './' ) ;
4039 expect ( result ) . toStrictEqual ( "./foo" ) ;
4140} ) ;
4241
@@ -45,22 +44,6 @@ test("constructPath with root", () => {
4544 expect ( result ) . toStrictEqual ( "./bar/foo" ) ;
4645} ) ;
4746
48- test ( "constructUrlPath minimal" , ( ) => {
49- const result = constructUrlPath ( ) ;
50- expect ( result ) . toStrictEqual ( "" ) ;
51- } ) ;
52-
53- test ( "constructUrlPath with base url" , ( ) => {
54- const result = constructUrlPath ( "bar.txt" , "file:///bin/foo/biz" ) ;
55- expect ( result ) . toStrictEqual ( "/bin/foo/bar.txt" ) ;
56- } ) ;
57-
58- test ( "constructUrlPath with base url and no debug" , ( ) => {
59- const spy = jest . spyOn ( console , "error" ) . mockImplementation ( ( ) => undefined ) ;
60- constructUrlPath ( "bar.txt" , "bin/foo/biz" ) ;
61- expect ( spy ) . toHaveBeenCalled ( ) ;
62- } ) ;
63-
6447test ( "constructImportMap minimal" , ( ) => {
6548 const result = constructImportMap ( ) ;
6649 expect ( result ) . toBeInstanceOf ( ImportMap ) ;
@@ -81,7 +64,7 @@ test("constructImportMap should return ImportMap instance if path exists", () =>
8164test ( "constructImportMap should use cwd if no path provided" , ( ) => {
8265 constructImportMap ( ) ;
8366 expect ( ImportMap ) . toHaveBeenCalledWith ( {
84- rootUrl : process . cwd ( ) ,
67+ rootUrl : `file:// ${ process . cwd ( ) } ` ,
8568 map : { } ,
8669 } ) ;
8770} ) ;
@@ -101,7 +84,7 @@ test("createCacheMap.get should return cachePath if defined", () => {
10184
10285test ( "createCacheMap.get should return undefined if cachePath is not defined" , ( ) => {
10386 const cacheMap = createCacheMap ( ) ;
104- expect ( cacheMap . get ( "foo" ) ) . toBeUndefined ( ) ;
87+ expect ( cacheMap . get ( "foo" ) ) . toEqual ( "foo" ) ;
10588} ) ;
10689
10790test ( "createCacheMap.set should set cachePath and modulePath" , ( ) => {
0 commit comments