@@ -14,7 +14,7 @@ const tsconfigMap = {
1414}
1515
1616describe ( 'pathsToModuleNameMapper' , ( ) => {
17- it ( 'should convert tsconfig mapping' , ( ) => {
17+ it ( 'should convert tsconfig mapping with no given prefix ' , ( ) => {
1818 expect ( pathsToModuleNameMapper ( tsconfigMap ) ) . toMatchInlineSnapshot ( `
1919 Object {
2020 "^api/(.*)$": "src/api/$1",
@@ -35,25 +35,8 @@ describe('pathsToModuleNameMapper', () => {
3535 ` )
3636 } )
3737
38- it ( 'should use the given prefix' , ( ) => {
39- expect ( pathsToModuleNameMapper ( tsconfigMap , { prefix : '<rootDir>/' } ) ) . toMatchInlineSnapshot ( `
40- Object {
41- "^api/(.*)$": "<rootDir>/src/api/$1",
42- "^client$": Array [
43- "<rootDir>/src/client",
44- "<rootDir>/src/client/index",
45- ],
46- "^log$": "<rootDir>/src/utils/log",
47- "^mocks/(.*)$": "<rootDir>/test/mocks/$1",
48- "^server$": "<rootDir>/src/server",
49- "^test/(.*)$": "<rootDir>/test/$1",
50- "^test/(.*)/mock$": Array [
51- "<rootDir>/test/mocks/$1",
52- "<rootDir>/test/__mocks__/$1",
53- ],
54- "^util/(.*)$": "<rootDir>/src/utils/$1",
55- }
56- ` )
38+ it . each ( [ '<rootDir>/' , 'foo' ] ) ( 'should convert tsconfig mapping with given prefix' , ( prefix ) => {
39+ expect ( pathsToModuleNameMapper ( tsconfigMap , { prefix } ) ) . toMatchSnapshot ( prefix )
5740 } )
5841
5942 it ( 'should warn about mapping it cannot handle' , ( ) => {
0 commit comments