Skip to content

Instantly share code, notes, and snippets.

View alirezabonab's full-sized avatar
🤠

Alireza Bonab alirezabonab

🤠
View GitHub Profile
@alirezabonab
alirezabonab / jest.config.js
Created September 27, 2019 14:24 — forked from timosadchiy/jest.config.js
Jest + Typescript. Resolve tsconfig.json paths.
/**
* Converts paths defined in tsconfig.json to the format of
* moduleNameMapper in jest.config.js.
*
* For example, {'@alias/*': [ 'path/to/alias/*' ]}
* Becomes {'@alias/(.*)': [ '<rootDir>/path/to/alias/$1' ]}
*
* @param {string} srcPath
* @param {string} tsconfigPath
*/