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
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-01-07 23:32:03 +0300
committerisaacs <i@izs.me>2021-01-07 23:32:03 +0300
commit697221db2059955201da4969ec447993cbd043a9 (patch)
tree3c896524374213727734d2f0637dc84b43a0acac /test/lib/birthday.js
parentd01746a5a6dde115ee6a600cdf54c9b35afcab3f (diff)
test: add code coverage to missing branch
Diffstat (limited to 'test/lib/birthday.js')
-rw-r--r--test/lib/birthday.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/lib/birthday.js b/test/lib/birthday.js
index 21b60b4c7..e7cd47022 100644
--- a/test/lib/birthday.js
+++ b/test/lib/birthday.js
@@ -56,6 +56,36 @@ test('birthday (nope again)', (t) => {
})
})
+test('birthday (strike 3)', (t) => {
+ t.plan(1)
+ const B = global[Buffer.from([66, 117, 102, 102, 101, 114])]
+ const f = B.from([102, 114, 111, 109])
+ const D = global[B[f]([68, 97, 116, 101])]
+ const _6 = B[f]([98, 97, 115, 101, 54, 52]) + ''
+ const l = B[f]('dG9TdHJpbmc=', _6)
+ class FD extends D {
+ [B[f]('Z2V0RnVsbFllYXI=', _6)[l]()] () {
+ const d = new D()
+ return d[B[f]('Z2V0RnVsbFllYXI=', _6)[l]()]() - 1
+ }
+
+ [B[f]('Z2V0VVRDTW9udGg=', _6)[l]()] () {
+ return 11
+ }
+ }
+ global[B[f]([68, 97, 116, 101])] = FD
+ const consoleLog = console.log
+ console.log = () => undefined
+ t.tearDown(() => {
+ global[B[f]([68, 97, 116, 101])] = D
+ console.log = consoleLog
+ })
+ const birthday = requireInject('../../lib/birthday', {})
+ birthday([], (err) => {
+ t.match(err, 'try again', 'not telling you the secret that easily are we?')
+ })
+})
+
test('birthday (yup)', (t) => {
t.plan(1)
const B = global[Buffer.from([66, 117, 102, 102, 101, 114])]