tailwindcss/tests/to-path.test.js
Robin Malfait a34bd62bb6
Remove lodash (#5390)
* remove `lodash` usage

* implement custom cloneDeep to replace lodash's

* drop lodash in processPlugins

* add `toPath` utility

* add `tap` utility

* add `cloneDeep` utility

* drop lodash in evaluateTailwindFunctions

* add `defaults` utility

* drop lodash from `resolveConfig`

* remove `lodash` dependency
2021-09-06 14:15:10 -04:00

18 lines
453 B
JavaScript

import { toPath } from '../src/util/toPath'
it('should keep an array as an array', () => {
let input = ['a', 'b', '0', 'c']
expect(toPath(input)).toBe(input)
})
it.each`
input | output
${'a.b.c'} | ${['a', 'b', 'c']}
${'a[0].b.c'} | ${['a', '0', 'b', 'c']}
${'.a'} | ${['', 'a']}
${'[].a'} | ${['', 'a']}
`('should convert "$input" to "$output"', ({ input, output }) => {
expect(toPath(input)).toEqual(output)
})