forked from stackcss/style-resolve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
36 lines (32 loc) · 879 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
var resolve = require('./')
var test = require('tape')
var path = require('path')
var fixtures = __dirname + '/fixtures'
test('defaults to index.css', function(t) {
t.plan(1)
t.equal(
resolve.sync(path.resolve(fixtures, 'default'))
, path.resolve(fixtures, 'default/index.css')
)
})
test('uses style field in package.json', function(t) {
t.plan(1)
t.equal(
resolve.sync(path.resolve(fixtures, 'style'))
, path.resolve(fixtures, 'style/style.css')
)
})
test('uses main field in package.json', function(t) {
t.plan(1)
t.equal(
resolve.sync(path.resolve(fixtures, 'use_main'))
, path.resolve(fixtures, 'use_main/main.css')
)
})
test('not uses main field in package.json', function(t) {
t.plan(1)
t.equal(
resolve.sync(path.resolve(fixtures, 'not_use_main'))
, path.resolve(fixtures, 'not_use_main/index.css')
)
})