Add test to make sure custom config is actually used
This commit is contained in:
parent
f84507457f
commit
fc19bc2e89
2 changed files with 33 additions and 0 deletions
28
__tests__/customConfig.test.js
Normal file
28
__tests__/customConfig.test.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import path from 'path'
|
||||
import postcss from 'postcss'
|
||||
import tailwind from '../src/index'
|
||||
|
||||
test('it uses the values from the custom config file', () => {
|
||||
return postcss([tailwind(path.resolve(`${__dirname}/fixtures/customConfig.js`))])
|
||||
.process(`
|
||||
@responsive {
|
||||
.foo {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
`)
|
||||
.then(result => {
|
||||
const expected = `
|
||||
.foo {
|
||||
color: blue;
|
||||
}
|
||||
@media (min-width: 400px) {
|
||||
.mobile\\:foo {
|
||||
color: blue;
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
expect(result.css).toMatchCss(expected)
|
||||
})
|
||||
})
|
||||
5
__tests__/fixtures/customConfig.js
Normal file
5
__tests__/fixtures/customConfig.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
screens: {
|
||||
mobile: '400px',
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue