Skip to content

Commit

Permalink
chore: fix tests for zlib differences between node versions (#340)
Browse files Browse the repository at this point in the history
Good explanation at nodejs/node#50138
  • Loading branch information
wraithgar authored Dec 1, 2023
1 parent 0c96b9e commit a06a459
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions tap-snapshots/test/dir.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
exports[`test/dir.js TAP basic > extract 1`] = `
Object {
"from": "file:test/fixtures/abbrev",
"integrity": "sha512-4LQrO8XIPkwgx2wanFZU5bCNmzB1dzTbDtgozDs2uqGLj0x1De97lOP3BFEtlsZDFOquwrJt0IHsjEFfgfDyVA==",
"integrity": "{integrity}",
"resolved": "\${CWD}/test/fixtures/abbrev",
}
`
Expand Down Expand Up @@ -151,7 +151,7 @@ Object {
"tap": "^10.1",
},
"dist": Object {
"integrity": "sha512-whatever-this-is-only-checked-if-we-extract-it",
"integrity": "{integrity}",
"tarball": "file:\${CWD}/test/fixtures/abbrev",
},
"files": Array [
Expand All @@ -176,15 +176,15 @@ Object {
exports[`test/dir.js TAP make bins executable > results of unpack 1`] = `
Object {
"from": "file:test/fixtures/bin-object",
"integrity": "sha512-hvYyDtqhAkxg/NF7eOjCpDcIs7ksaZjk9vrBkktxTJ0liITA/FsnEgmbP9l8h3rp+zN1QIvKAUvyTCYRpyCqZQ==",
"integrity": "{integrity}",
"resolved": "\${CWD}/test/fixtures/bin-object",
}
`

exports[`test/dir.js TAP responds to foregroundScripts: true > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
"integrity": "sha512-shf/7QYgFII06kJbyyqj4u86uLuyJnD0xVGLm0XDkC6nuVU+GBHwQ9uogbLUQnBu0gSvcWYVnO1TyPxj+YQDdw==",
"integrity": "{integrity}",
"resolved": "\${CWD}/test/fixtures/prepare-script",
}
`
Expand Down Expand Up @@ -250,7 +250,7 @@ Object {
exports[`test/dir.js TAP responds to foregroundScripts: true and silent: true > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
"integrity": "sha512-shf/7QYgFII06kJbyyqj4u86uLuyJnD0xVGLm0XDkC6nuVU+GBHwQ9uogbLUQnBu0gSvcWYVnO1TyPxj+YQDdw==",
"integrity": "{integrity}",
"resolved": "\${CWD}/test/fixtures/prepare-script",
}
`
Expand Down Expand Up @@ -316,7 +316,7 @@ Object {
exports[`test/dir.js TAP with prepare script > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
"integrity": "sha512-shf/7QYgFII06kJbyyqj4u86uLuyJnD0xVGLm0XDkC6nuVU+GBHwQ9uogbLUQnBu0gSvcWYVnO1TyPxj+YQDdw==",
"integrity": "{integrity}",
"resolved": "\${CWD}/test/fixtures/prepare-script",
}
`
Expand Down
4 changes: 3 additions & 1 deletion test/dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const { relative, resolve, basename } = require('path')

const me = t.testdir()

t.cleanSnapshot = str => str.split(process.cwd()).join('${CWD}')
t.cleanSnapshot = str => str
.split(process.cwd()).join('${CWD}')
.replace(/"integrity": ".*",/g, '"integrity": "{integrity}",')

const abbrev = resolve(__dirname, 'fixtures/abbrev')
const abbrevspec = `file:${relative(process.cwd(), abbrev)}`
Expand Down

0 comments on commit a06a459

Please sign in to comment.