-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
28 lines (20 loc) · 664 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
!function() {
var swatcher = require('./')
function ok(actual, correct) {
if (correct !== actual) {
throw new Error(actual + ' should be ' + correct)
}
}
var red = {red: 'red'}
ok(swatcher() instanceof swatcher, true)
ok(swatcher().assign({}) instanceof swatcher, true)
ok(swatcher().json(), '{}')
ok(swatcher().assign(red).json(), JSON.stringify(red))
ok(swatcher().css(), '')
ok(swatcher().assign(red).css(), '--red: red;')
ok(swatcher().scss(), '')
ok(swatcher().assign(red).scss(), '$red: red;')
ok(swatcher().less(), '')
ok(swatcher().assign(red).less(), '@red: red;')
console.log('All tests passed!')
}();