diff --git a/__tests__/customConfig.test.js b/__tests__/customConfig.test.js new file mode 100644 index 000000000..b39536d37 --- /dev/null +++ b/__tests__/customConfig.test.js @@ -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) + }) +}) diff --git a/__tests__/fixtures/customConfig.js b/__tests__/fixtures/customConfig.js new file mode 100644 index 000000000..495c7307d --- /dev/null +++ b/__tests__/fixtures/customConfig.js @@ -0,0 +1,5 @@ +module.exports = { + screens: { + mobile: '400px', + } +}