Skip to content

Commit 8f2f2e5

Browse files
committed
test: add more test cases
1 parent 2d73cfb commit 8f2f2e5

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

tests/types/types.test.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ css.configs.recommended.plugins satisfies object;
167167
Function: (...args) => testVisitor<FunctionNodePlain>(...args),
168168
"Function:exit": (...args) =>
169169
testVisitor<FunctionNodePlain>(...args),
170-
GeneralEnclosed: (...args) => testVisitor<any>(...args),
171-
"GeneralEnclosed:exit": (...args) => testVisitor<any>(...args),
170+
GeneralEnclosed: (node: any, parent: CssNodePlain) =>
171+
testVisitor<any>(node, parent),
172+
"GeneralEnclosed:exit": (node: any, parent: CssNodePlain) =>
173+
testVisitor<any>(node, parent),
172174
Hash: (...args) => testVisitor<Hash>(...args),
173175
"Hash:exit": (...args) => testVisitor<Hash>(...args),
174176
IdSelector: (...args) => testVisitor<IdSelector>(...args),
@@ -217,8 +219,10 @@ css.configs.recommended.plugins satisfies object;
217219
"Raw:exit": (...args) => testVisitor<Raw>(...args),
218220
Rule: (...args) => testVisitor<RulePlain>(...args),
219221
"Rule:exit": (...args) => testVisitor<RulePlain>(...args),
220-
Scope: (...args) => testVisitor<any>(...args),
221-
"Scope:exit": (...args) => testVisitor<any>(...args),
222+
Scope: (node: any, parent: CssNodePlain) =>
223+
testVisitor<any>(node, parent),
224+
"Scope:exit": (node: any, parent: CssNodePlain) =>
225+
testVisitor<any>(node, parent),
222226
Selector: (...args) => testVisitor<SelectorPlain>(...args),
223227
"Selector:exit": (...args) => testVisitor<SelectorPlain>(...args),
224228
SelectorList: (...args) => testVisitor<SelectorListPlain>(...args),
@@ -246,8 +250,18 @@ css.configs.recommended.plugins satisfies object;
246250
WhiteSpace: (...args) => testVisitor<WhiteSpace>(...args),
247251
"WhiteSpace:exit": (...args) => testVisitor<WhiteSpace>(...args),
248252

249-
// Unknown selectors allowed
253+
// Combined selectors allowed
250254
"Atrule[name=import]"(node: AtrulePlain, parent: CssNodePlain) {},
255+
"*"(node: CssNodePlain) {},
256+
"Selector:first-child"(node: SelectorPlain) {},
257+
"Selector:last-child"(node: SelectorPlain) {},
258+
"Value Number"(node: NumberNode) {},
259+
"String, Number"(node: StringNode | NumberNode) {},
260+
261+
// Unknown selectors allowed
262+
ForStatement(node) {},
263+
Unknown(node) {},
264+
ValueNode(node) {},
251265
};
252266
},
253267
});

0 commit comments

Comments
 (0)