Test config can be passed as object instead of path

This commit is contained in:
Adam Wathan 2018-06-25 08:35:01 -04:00
parent 46058cf6c8
commit 6fb772cb71

View File

@ -29,3 +29,35 @@ test('it uses the values from the custom config file', () => {
expect(result.css).toMatchCss(expected)
})
})
test('custom config can be passed as an object', () => {
return postcss([tailwind({
screens: {
mobile: '400px',
},
})])
.process(
`
@responsive {
.foo {
color: blue;
}
}
`,
{ from: undefined }
)
.then(result => {
const expected = `
.foo {
color: blue;
}
@media (min-width: 400px) {
.mobile\\:foo {
color: blue;
}
}
`
expect(result.css).toMatchCss(expected)
})
})