source: trip-planner-front/node_modules/indexes-of/test.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 689 bytes
Line 
1
2var tape = require('tape')
3
4var indexes = require('./')
5
6tape('indexes of - 2 matches', function (t) {
7 var x = indexes([1,2,3, 2,4,5,9,8,0], 2)
8 t.deepEqual(x, [1,3])
9 t.end()
10})
11
12
13tape('indexes of - 1 match', function (t) {
14 var x = indexes([1,2,3, 2,4,5,9,8,0], 2)
15 t.deepEqual(x, [1,3])
16 t.end()
17})
18
19
20tape('indexes of - empty', function (t) {
21 var x = indexes([1,2,3, 2,4,5,9,8,0], 24)
22 t.deepEqual(x, [])
23 t.end()
24})
25
26
27tape('indexes of - empty', function (t) {
28 var x = indexes([8,8,8,8,8,8,8], 8)
29 t.deepEqual(x, [0,1,2,3,4,5,6])
30 t.end()
31})
32
33
34tape('indexes of - string', function (t) {
35 var x = indexes('foo bar baz foo', 'foo')
36 t.deepEqual(x, [0, 12])
37 t.end()
38})
Note: See TracBrowser for help on using the repository browser.