tailwindcss/tests/shared-state.test.js
Robin Malfait 875c850b37
Improve DEBUG parsing: only take care of tailwindcss and not tailwind (#6804)
* only take care of `tailwindcss` and not `tailwind`

* update changelog
2021-12-30 16:41:23 +01:00

21 lines
744 B
JavaScript

import { resolveDebug } from '../src/lib/sharedState'
it.each`
value | expected
${'true'} | ${true}
${'1'} | ${true}
${'false'} | ${false}
${'0'} | ${false}
${'*'} | ${true}
${'tailwindcss'} | ${true}
${'tailwindcss:*'} | ${true}
${'other,tailwindcss'} | ${true}
${'other,tailwindcss:*'} | ${true}
${'other,-tailwindcss'} | ${false}
${'other,-tailwindcss:*'} | ${false}
${'-tailwindcss'} | ${false}
${'-tailwindcss:*'} | ${false}
`('should resolve the debug ($value) flag correctly ($expected)', ({ value, expected }) => {
expect(resolveDebug(value)).toBe(expected)
})