Skip to content

Commit

Permalink
chore: fix readFile mock in package-json-read-fail test
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf committed Apr 4, 2022
1 parent cdbdc5e commit 6d62018
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/package-json-read-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const t = require('tap')
const fs = require('fs')
const { join } = require('path')

const pkg = t.testdir({
'package.json': 'no json here',
Expand All @@ -14,7 +13,8 @@ const packlist = t.mock('../', {
fs: {
...fs,
readFile: (path, options, callback) => {
if (path === join(pkg, 'package.json')) {
// this is _not_ an os specific path
if (path === `${pkg}/package.json`) {
if (typeof options === 'function') {
callback = options
options = undefined
Expand Down

0 comments on commit 6d62018

Please sign in to comment.