Skip to content

Commit fc19bc2

Browse files
committed
Add test to make sure custom config is actually used
1 parent f845074 commit fc19bc2

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

__tests__/customConfig.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import path from 'path'
2+
import postcss from 'postcss'
3+
import tailwind from '../src/index'
4+
5+
test('it uses the values from the custom config file', () => {
6+
return postcss([tailwind(path.resolve(`${__dirname}/fixtures/customConfig.js`))])
7+
.process(`
8+
@responsive {
9+
.foo {
10+
color: blue;
11+
}
12+
}
13+
`)
14+
.then(result => {
15+
const expected = `
16+
.foo {
17+
color: blue;
18+
}
19+
@media (min-width: 400px) {
20+
.mobile\\:foo {
21+
color: blue;
22+
}
23+
}
24+
`
25+
26+
expect(result.css).toMatchCss(expected)
27+
})
28+
})

__tests__/fixtures/customConfig.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
screens: {
3+
mobile: '400px',
4+
}
5+
}

0 commit comments

Comments
 (0)