From 67ac9ff68b1dd26fe0c7e2de9e3646bed7e37391 Mon Sep 17 00:00:00 2001 From: Deyan Totev Date: Thu, 30 Nov 2023 14:58:16 +0200 Subject: [PATCH] chore@small --- .vscode/launch.json | 2 +- source/pluck.spec.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 08252d29..a8661dee 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,7 +4,7 @@ { "type": "node", "request": "launch", - "name": "Current Test File", + "name": "Test File(current)", "program": "${workspaceRoot}/node_modules/jest/bin/jest.js", "args": [ "--verbose", diff --git a/source/pluck.spec.js b/source/pluck.spec.js index fe872eb4..ed167f7b 100644 --- a/source/pluck.spec.js +++ b/source/pluck.spec.js @@ -4,6 +4,10 @@ test('happy', () => { expect(pluck('a')([ { a : 1 }, { a : 2 }, { b : 1 } ])).toEqual([ 1, 2 ]) }) +test('with undefined', () => { + expect(pluck(undefined)([ { a : 1 }, { a : 2 }, { b : 1 } ])).toEqual([ ]) +}) + test('with number', () => { const input = [ [ 1, 2 ],