jest-serializer-path
Remove absolute paths from your Jest snapshots.
Quick Start
npm install --save-dev jest-serializer-path
Add this to your package.json
Jest config:
"jest": {
"snapshotSerializers": [
"jest-serializer-path"
]
}
Or include only in individual tests:
const serializer = require('jest-serializer-path')
expect.addSnapshotSerializer(serializer)
All absolute paths will now be converted and saved in snapshots like so:
/path/to/my-proj/lib
=> <PROJECT_ROOT>/lib
Build
This project bundles the yarn executable and the npm/yarn dependencies offline
in the .npm-packages-offline-cache
directory for faster dependency installs
and better dev/prod parity across including preventing failure if yarn/npm is
offline.
npm run yarn
npm run test