-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test.js
37 lines (28 loc) · 952 Bytes
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const {multiStringSearch} = require('.');
test('multi-string', () => {
// Arrange
const bigString = "this is a big string";
const smallStrings = ["this", "yo", "is", "a", "bigger", "string", "kappa"];
// Act
const result = multiStringSearch(bigString, smallStrings);
// Assert
expect(result).toEqual([true, false, true, true, false, true, false]);
});
test('multi-string use case two', () => {
// Arrange
const bigString = "abcdefghijklmnopqrstuvwxyz";
const smallStrings = ["abc", "mnopqr", "wyz", "no", "e", "tuuv"];
// Act
const result = multiStringSearch(bigString, smallStrings);
// Assert
expect(result).toEqual([true, true, false, true, true, false]);
});
test('multi-string use case three', () => {
// Arrange
const bigString = "bbbabb";
const smallStrings = ["bbabb"];
// Act
const result = multiStringSearch(bigString, smallStrings);
// Assert
expect(result).toEqual([true]);
});