tailwindcss/tests/to-path.test.js
Robin Malfait 44b3b429a8
Cleanup oxide — Part #2 (#13312)
* remove all oxide related code

* Update lightningcss to version 1.24.1

* update tests to match bumped Lightning CSS output

---------

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2024-03-22 17:12:14 +01:00

19 lines
513 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']}
${'a[1.5][b][c]'} | ${['a', '1.5', 'b', 'c']}
`('should convert "$input" to "$output"', ({ input, output }) => {
expect(toPath(input)).toEqual(output)
})