deno.land / x / rambda@v9.1.1 / source / pass.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
import { pass } from './pass.js'
test('true on success', () => { const result = pass( 1, 'foo', {} )( 'number', 'string', 'object' )
expect(result).toBeTrue()})
test('false on failure', () => { expect(pass( 1, 'foo', {} )( 'number', 'string', 'string' )).toBeFalse()})
test('true when single schema', () => { expect(pass( 1, 2, 3 )('number')).toBeTrue()})
test('false when single schema', () => { expect(pass( 1, 'foo', {} )('number')).toBeFalse()})
test('array of schemas', () => { const result = pass([ { a : 1 }, { a : 2 }, { a : 3 } ])([ { a : Number } ]) expect(result).toBeTruthy()})
test('reame example', () => { const result = pass(1, [ 'foo', 'bar' ])(Number, [ String ]) expect(result).toBeTruthy()})
rambda

Version Info

Tagged at
2 months ago