deno.land / x / rambda@v9.1.1 / source / objOf.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
import { objOf as objOfRamda } from 'ramda'
import { compareCombinations } from './_internals/testUtils.js'import { objOf } from './objOf.js'
test('happy', () => { expect(objOf('foo', 42)).toEqual({ foo : 42 })})
test('with bad inputs', () => { expect(objOf(null, undefined)).toEqual({ null : undefined })})
test('curried', () => { expect(objOf('foo')(42)).toEqual({ foo : 42 })})
describe('brute force', () => { const possibleInputs = [ 0, 1, null, undefined, [], {} ]
compareCombinations({ firstInput : possibleInputs, secondInput : possibleInputs, callback : errorsCounters => { expect(errorsCounters).toMatchInlineSnapshot(` { "ERRORS_MESSAGE_MISMATCH": 0, "ERRORS_TYPE_MISMATCH": 0, "RESULTS_MISMATCH": 0, "SHOULD_NOT_THROW": 0, "SHOULD_THROW": 0, "TOTAL_TESTS": 36, } `) }, fn : objOf, fnRamda : objOfRamda, })})
rambda

Version Info

Tagged at
2 months ago