Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2021-06-04 00:36:06 +0300
committerGar <gar+gh@danger.computer>2021-06-10 20:09:03 +0300
commit26d00c47785dfb300eab6a926f9d7c4d566776b1 (patch)
tree869f65e3e208e07673c75d3f9bb801ac83e6f815 /test
parent3654890fb3be8b57e73f7e6ac4d895017603ca9e (diff)
fix(tests): mock writeFile in pack tests so we dont create 0 byte files in the repo
PR-URL: https://github.com/npm/cli/pull/3364 Credit: @nlf Close: #3364 Reviewed-by: @wraithgar
Diffstat (limited to 'test')
-rw-r--r--test/lib/pack.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lib/pack.js b/test/lib/pack.js
index ff7bef19d..ad5bbf335 100644
--- a/test/lib/pack.js
+++ b/test/lib/pack.js
@@ -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: {
@@ -69,6 +72,9 @@ t.test('should pack given directory', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
+ fs: {
+ writeFile: (file, data, cb) => cb(),
+ },
})
const npm = mockNpm({
config: {
@@ -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: {
@@ -138,6 +147,9 @@ t.test('should log pack contents', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
+ fs: {
+ writeFile: (file, data, cb) => cb(),
+ },
})
const npm = mockNpm({
config: {
@@ -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: {
@@ -259,6 +274,9 @@ t.test('invalid packument', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
+ fs: {
+ writeFile: (file, data, cb) => cb(),
+ },
})
const npm = mockNpm({
config: {
@@ -305,6 +323,9 @@ t.test('workspaces', (t) => {
showProgress: () => {},
clearProgress: () => {},
},
+ fs: {
+ writeFile: (file, data, cb) => cb(),
+ },
})
const npm = mockNpm({
localPrefix: testDir,