shared-state.test.js 744 B

123456789101112131415161718192021
  1. import { resolveDebug } from '../src/lib/sharedState'
  2. it.each`
  3. value | expected
  4. ${'true'} | ${true}
  5. ${'1'} | ${true}
  6. ${'false'} | ${false}
  7. ${'0'} | ${false}
  8. ${'*'} | ${true}
  9. ${'tailwindcss'} | ${true}
  10. ${'tailwindcss:*'} | ${true}
  11. ${'other,tailwindcss'} | ${true}
  12. ${'other,tailwindcss:*'} | ${true}
  13. ${'other,-tailwindcss'} | ${false}
  14. ${'other,-tailwindcss:*'} | ${false}
  15. ${'-tailwindcss'} | ${false}
  16. ${'-tailwindcss:*'} | ${false}
  17. `('should resolve the debug ($value) flag correctly ($expected)', ({ value, expected }) => {
  18. expect(resolveDebug(value)).toBe(expected)
  19. })