Skip to content

Commit

Permalink
fix: bad case while use windicss cli with fuzzy
Browse files Browse the repository at this point in the history
  • Loading branch information
lianghx-319 committed Jan 14, 2022
1 parent 0a0f456 commit bb5dd2a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/parser/class.test.ts
Expand Up @@ -49,4 +49,15 @@ describe('ClassParser', () => {
const parser = new ClassParser(classes, ':', []);
expect(parser.parse()).toMatchSnapshot('bad half bracket');
});

it('parse function with parameter deconstruction', () => {
const badClasses = 'function ComponentA({ name }: Props) { return div className= grid }';
const goodClasses = '{ return div className= grid }';
const badResult = new ClassParser(badClasses, ':', []).parse();
const goodResult = new ClassParser(goodClasses, ':', []).parse();

const findGrid = (els: any[]) => els.find(item => item.raw === 'grid');
expect(findGrid(badResult)).toBeTruthy();
expect(findGrid(goodResult)).toBeTruthy();
});
});

0 comments on commit bb5dd2a

Please sign in to comment.