-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnode-like.test.ts
More file actions
40 lines (32 loc) · 1022 Bytes
/
node-like.test.ts
File metadata and controls
40 lines (32 loc) · 1022 Bytes
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 { should } from 'chai'; should();
import { PinMap } from '../../pin/pin-map';
import control from '../../pin/control';
import { isNodeLike } from '../node-like';
describe('isNodeLike()', () => {
it('should be true for stuff that are `NodeLike` and false for whatever else.', () => {
isNodeLike({
in(){}, out(){},
inputs: new PinMap(), outputs: new PinMap(),
signature: {outputs: []},
control: control(),
}).should.be.true;
isNodeLike({
in(){}, out(){},
inputs: new PinMap(), outputs: new PinMap(),
signature: {outputs: []}
}).should.be.false;
isNodeLike({
in(){}, out(){},
inputs: new PinMap(), outputs: new PinMap(),
signature: {outputs: []},
control: 'hellow',
}).should.be.false;
isNodeLike({
in(){}, out(){},
inputs: new PinMap(), outputs: new PinMap(),
control: control(),
}).should.be.false;
isNodeLike(true).should.be.false;
isNodeLike(undefined).should.be.false;
});
});