jest-serializer-path
Advanced tools
Comparing version 0.1.7 to 0.1.8
'use strict' | ||
const path = require('path') | ||
const Serializer = require('./') | ||
@@ -52,2 +53,16 @@ | ||
it('handles process.chdir <PROJECT_ROOT>', () => { | ||
const cwd = process.cwd() | ||
const cwdUpdated = path.join(cwd, 'lib') | ||
process.chdir(cwdUpdated) | ||
const sut = `${process.cwd()}/src/somewhere` | ||
expect(sut).toMatchSnapshot() | ||
process.chdir(cwd) | ||
}) | ||
it('replaces every instance of process.cwd in the same string', () => { | ||
@@ -54,0 +69,0 @@ |
@@ -6,8 +6,7 @@ 'use strict' | ||
// Replace absolute file paths with <PROJECT_ROOT> | ||
const cwd = process.cwd() | ||
module.exports = { | ||
print (val, serialize) { | ||
const cwd = process.cwd() | ||
if (isPath(val)) { | ||
@@ -75,2 +74,4 @@ | ||
const cwd = process.cwd() | ||
return typeof value === 'string' | ||
@@ -77,0 +78,0 @@ && value.indexOf(cwd) !== -1 |
{ | ||
"name": "jest-serializer-path", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Remove absolute paths from your Jest snapshots", | ||
@@ -5,0 +5,0 @@ "author": "tribou", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140120
177