deno.land / x / rambda@v9.1.1 / source / dropRepeats.spec.js

dropRepeats.spec.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
38
39
40
41
42
43
import { dropRepeats as dropRepeatsRamda } from 'ramda'
import { compareCombinations } from './_internals/testUtils.js'import { add } from './add.js'import { dropRepeats } from './dropRepeats.js'
const list = [ 1, 2, 2, 2, 3, 4, 4, 5, 5, 3, 2, 2, { a : 1 }, { a : 1 } ]const listClean = [ 1, 2, 3, 4, 5, 3, 2, { a : 1 } ]
test('happy', () => { const result = dropRepeats(list) expect(result).toEqual(listClean)})
const possibleLists = [ [ add(1), async () => {}, [ 1 ], [ 1 ], [ 2 ], [ 2 ] ], [ add(1), add(1), add(2) ], [], 1, /foo/g, Promise.resolve(1),]
describe('brute force', () => { compareCombinations({ firstInput : possibleLists, callback : errorsCounters => { expect(errorsCounters).toMatchInlineSnapshot(` { "ERRORS_MESSAGE_MISMATCH": 0, "ERRORS_TYPE_MISMATCH": 0, "RESULTS_MISMATCH": 1, "SHOULD_NOT_THROW": 3, "SHOULD_THROW": 0, "TOTAL_TESTS": 6, } `) }, fn : dropRepeats, fnRamda : dropRepeatsRamda, })})
rambda

Version Info

Tagged at
2 months ago