-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest.js
49 lines (34 loc) · 1007 Bytes
/
test.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
45
46
47
48
49
var test = require('tape')
var c = require('.')
test('c.use()', function (t) {
c.use({
component: () => prop => console.log(prop)
})
var box = c._inspect()
t.ok('component' in box.components, '`component` passed into box')
t.end()
})
test('c(\'component\')', function (t) {
c('component')
var box = c._inspect()
t.ok(box._cache.get('component'), '`component` created and cached as `component`')
t.end()
})
test('c(\'component\', \'custom\')', function (t) {
c('component', 'custom')
var box = c._inspect()
t.ok(box._cache.get('component-custom'), '`component` created and cached as `custom`')
t.end()
})
test('c.delete(\'component\')', function (t) {
c.delete('component')
var box = c._inspect()
t.notOk(box._cache.get('component'), '`component` uncached')
t.end()
})
test('c(\'component\', false)', function (t) {
c('component', false)
var box = c._inspect()
t.notOk(box._cache.get('component'), '`component` created and not cached')
t.end()
})