Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): mock writeFile in pack tests #3364

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions test/lib/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ t.test('should pack current directory with no arguments', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
fs: {
writeFile: (file, data, cb) => cb(),
},
})
const npm = mockNpm({
config: {
Expand Down Expand Up @@ -69,6 +72,9 @@ t.test('should pack given directory', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
fs: {
writeFile: (file, data, cb) => cb(),
},
})
const npm = mockNpm({
config: {
Expand Down Expand Up @@ -104,6 +110,9 @@ t.test('should pack given directory for scoped package', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
fs: {
writeFile: (file, data, cb) => cb(),
},
})
const npm = mockNpm({
config: {
Expand Down Expand Up @@ -138,6 +147,9 @@ t.test('should log pack contents', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
fs: {
writeFile: (file, data, cb) => cb(),
},
})
const npm = mockNpm({
config: {
Expand Down Expand Up @@ -209,6 +221,9 @@ t.test('should log output as valid json', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
fs: {
writeFile: (file, data, cb) => cb(),
},
})
const npm = mockNpm({
config: {
Expand Down Expand Up @@ -259,6 +274,9 @@ t.test('invalid packument', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
fs: {
writeFile: (file, data, cb) => cb(),
},
})
const npm = mockNpm({
config: {
Expand Down Expand Up @@ -305,6 +323,9 @@ t.test('workspaces', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
fs: {
writeFile: (file, data, cb) => cb(),
},
})
const npm = mockNpm({
localPrefix: testDir,
Expand Down