From 6fb772cb717c0e9704beafcd698d2e780513f6ca Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Mon, 25 Jun 2018 08:35:01 -0400 Subject: [PATCH] Test config can be passed as object instead of path --- __tests__/customConfig.test.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/__tests__/customConfig.test.js b/__tests__/customConfig.test.js index 24399bb43..f0c32aa93 100644 --- a/__tests__/customConfig.test.js +++ b/__tests__/customConfig.test.js @@ -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) + }) +})