We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1cd6613 commit 886e4fdCopy full SHA for 886e4fd
src/_Problems_/get-smallest-common-number/get-smallest-common-number.test.js
@@ -0,0 +1,24 @@
1
+const { getSmallestCommonNumber } = require('.');
2
+
3
+describe('Get common smallest number between two integer arrays', () => {
4
+ it('Should return -1 when both has empty array', () => {
5
+ const arr1 = [];
6
+ const arr2 = [];
7
8
+ expect(getSmallestCommonNumber(arr1, arr2)).toEqual(-1);
9
+ });
10
11
+ it('Should return -1 when no common between two integer arrays', () => {
12
+ const arr1 = [1, 3, 5];
13
+ const arr2 = [2, 4, 6];
14
15
16
17
18
+ it('Should return common smallest number between two integer arrays', () => {
19
+ const arr1 = [2, 3];
20
+ const arr2 = [2, 5, 7];
21
22
+ expect(getSmallestCommonNumber(arr1, arr2)).toEqual(2);
23
24
+});
0 commit comments