|
| 1 | +// Jest Snapshot v1, https://goo.gl/fbAQLP |
| 2 | + |
| 3 | +exports[`Test lockfile: check patch with lockfile 1 1`] = ` |
| 4 | +"SNAPSHOT: check patch with lockfile 1 |
| 5 | +diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js |
| 6 | +index e90aec3..7f8fdaa 100644 |
| 7 | +--- a/node_modules/left-pad/index.js |
| 8 | ++++ b/node_modules/left-pad/index.js |
| 9 | +@@ -22,9 +22,9 @@ var cache = [ |
| 10 | + function leftPad (str, len, ch) { |
| 11 | + // convert \`str\` to a \`string\` |
| 12 | + str = str + ''; |
| 13 | +- // \`len\` is the \`pad\`'s length now |
| 14 | ++ // \`len\` is the \`npm\`'s length now |
| 15 | + len = len - str.length; |
| 16 | +- // doesn't need to pad |
| 17 | ++ // doesn't need to npm |
| 18 | + if (len <= 0) return str; |
| 19 | + // \`ch\` defaults to \`' '\` |
| 20 | + if (!ch && ch !== 0) ch = ' '; |
| 21 | +@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { |
| 22 | + ch = ch + ''; |
| 23 | + // cache common use cases |
| 24 | + if (ch === ' ' && len < 10) return cache[len] + str; |
| 25 | +- // \`pad\` starts with an empty string |
| 26 | +- var pad = ''; |
| 27 | ++ // \`npm\` starts with an empty string |
| 28 | ++ var npm = ''; |
| 29 | + // loop |
| 30 | + while (true) { |
| 31 | +- // add \`ch\` to \`pad\` if \`len\` is odd |
| 32 | +- if (len & 1) pad += ch; |
| 33 | ++ // add \`ch\` to \`npm\` if \`len\` is odd |
| 34 | ++ if (len & 1) npm += ch; |
| 35 | + // divide \`len\` by 2, ditch the remainder |
| 36 | + len >>= 1; |
| 37 | + // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` |
| 38 | +@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { |
| 39 | + // \`len\` is 0, exit the loop |
| 40 | + else break; |
| 41 | + } |
| 42 | +- // pad \`str\`! |
| 43 | +- return pad + str; |
| 44 | ++ // npm \`str\`! |
| 45 | ++ return npm + str; |
| 46 | + } |
| 47 | +END SNAPSHOT" |
| 48 | +`; |
| 49 | +
|
| 50 | +exports[`Test lockfile: check patch with lockfile 2 1`] = ` |
| 51 | +"SNAPSHOT: check patch with lockfile 2 |
| 52 | +diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js |
| 53 | +index e90aec3..7f8fdaa 100644 |
| 54 | +--- a/node_modules/left-pad/index.js |
| 55 | ++++ b/node_modules/left-pad/index.js |
| 56 | +@@ -22,9 +22,9 @@ var cache = [ |
| 57 | + function leftPad (str, len, ch) { |
| 58 | + // convert \`str\` to a \`string\` |
| 59 | + str = str + ''; |
| 60 | +- // \`len\` is the \`pad\`'s length now |
| 61 | ++ // \`len\` is the \`npm\`'s length now |
| 62 | + len = len - str.length; |
| 63 | +- // doesn't need to pad |
| 64 | ++ // doesn't need to npm |
| 65 | + if (len <= 0) return str; |
| 66 | + // \`ch\` defaults to \`' '\` |
| 67 | + if (!ch && ch !== 0) ch = ' '; |
| 68 | +@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { |
| 69 | + ch = ch + ''; |
| 70 | + // cache common use cases |
| 71 | + if (ch === ' ' && len < 10) return cache[len] + str; |
| 72 | +- // \`pad\` starts with an empty string |
| 73 | +- var pad = ''; |
| 74 | ++ // \`npm\` starts with an empty string |
| 75 | ++ var npm = ''; |
| 76 | + // loop |
| 77 | + while (true) { |
| 78 | +- // add \`ch\` to \`pad\` if \`len\` is odd |
| 79 | +- if (len & 1) pad += ch; |
| 80 | ++ // add \`ch\` to \`npm\` if \`len\` is odd |
| 81 | ++ if (len & 1) npm += ch; |
| 82 | + // divide \`len\` by 2, ditch the remainder |
| 83 | + len >>= 1; |
| 84 | + // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` |
| 85 | +@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { |
| 86 | + // \`len\` is 0, exit the loop |
| 87 | + else break; |
| 88 | + } |
| 89 | +- // pad \`str\`! |
| 90 | +- return pad + str; |
| 91 | ++ // npm \`str\`! |
| 92 | ++ return npm + str; |
| 93 | + } |
| 94 | +END SNAPSHOT" |
| 95 | +`; |
| 96 | +
|
| 97 | +exports[`Test lockfile: check patch with lockfile 3 1`] = ` |
| 98 | +"SNAPSHOT: check patch with lockfile 3 |
| 99 | +diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js |
| 100 | +index e90aec3..7f8fdaa 100644 |
| 101 | +--- a/node_modules/left-pad/index.js |
| 102 | ++++ b/node_modules/left-pad/index.js |
| 103 | +@@ -22,9 +22,9 @@ var cache = [ |
| 104 | + function leftPad (str, len, ch) { |
| 105 | + // convert \`str\` to a \`string\` |
| 106 | + str = str + ''; |
| 107 | +- // \`len\` is the \`pad\`'s length now |
| 108 | ++ // \`len\` is the \`npm\`'s length now |
| 109 | + len = len - str.length; |
| 110 | +- // doesn't need to pad |
| 111 | ++ // doesn't need to npm |
| 112 | + if (len <= 0) return str; |
| 113 | + // \`ch\` defaults to \`' '\` |
| 114 | + if (!ch && ch !== 0) ch = ' '; |
| 115 | +@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { |
| 116 | + ch = ch + ''; |
| 117 | + // cache common use cases |
| 118 | + if (ch === ' ' && len < 10) return cache[len] + str; |
| 119 | +- // \`pad\` starts with an empty string |
| 120 | +- var pad = ''; |
| 121 | ++ // \`npm\` starts with an empty string |
| 122 | ++ var npm = ''; |
| 123 | + // loop |
| 124 | + while (true) { |
| 125 | +- // add \`ch\` to \`pad\` if \`len\` is odd |
| 126 | +- if (len & 1) pad += ch; |
| 127 | ++ // add \`ch\` to \`npm\` if \`len\` is odd |
| 128 | ++ if (len & 1) npm += ch; |
| 129 | + // divide \`len\` by 2, ditch the remainder |
| 130 | + len >>= 1; |
| 131 | + // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` |
| 132 | +@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { |
| 133 | + // \`len\` is 0, exit the loop |
| 134 | + else break; |
| 135 | + } |
| 136 | +- // pad \`str\`! |
| 137 | +- return pad + str; |
| 138 | ++ // npm \`str\`! |
| 139 | ++ return npm + str; |
| 140 | + } |
| 141 | +END SNAPSHOT" |
| 142 | +`; |
0 commit comments