Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-serializer-path

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-serializer-path - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

15

lib/index_test.js
'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 @@

7

lib/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc