-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlog.js
44 lines (36 loc) · 1.7 KB
/
log.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
44
import describe from 'tape-bdd';
import transmute from 'transmutation';
describe('Log Operator', (it) => {
it.skip('actually logs value with console log', assert => transmute({ testing: { parameter: 'roar' } })
.log()
.then(() => assert.ok(true))
);
it.skip('actually logs scoped value with console log', assert => transmute({ testing: { parameter: 'roar' } })
.log('testing.parameter')
.then(() => assert.ok(true))
);
it.skip('actually logs titled value with console log', assert => transmute({ testing: { parameter: 'roar' } })
.log('my title')
.then(() => assert.ok(true))
);
it.skip('actually logs a titled and scoped value with console log', assert => transmute({ testing: { parameter: 'roar' } })
.log('my title', 'testing.parameter')
.then(() => assert.ok(true))
);
it('logs to the given function', assert => transmute({ testing: { parameter: 'roar' } })
.log(value => assert.deepEqual(value, { testing: { parameter: 'roar' } }))
.then()
);
it('logs a scoped value to the given function', assert => transmute({ testing: { parameter: 'roar' } })
.log('testing.parameter', value => assert.deepEqual(value, 'roar'))
.then()
);
it('logs a titled value to the given function', assert => transmute('roar')
.log('my title', (title, value) => assert.ok(title === 'my title' && value === 'roar'))
.then()
);
it('logs a scoped and titled value to the given function', assert => transmute({ testing: { parameter: 'roar' } })
.log('my title', 'testing.parameter', (title, value) => assert.ok(title === 'my title' && value === 'roar'))
.then()
);
});