|
@@ -347,13 +347,9 @@ test('parse mixin application', (t) => {
|
347
|
347
|
result.tree[0],
|
348
|
348
|
new AST.RuleSet(
|
349
|
349
|
[new AST.Selector(literalToken('div'))],
|
350
|
|
- [
|
351
|
|
- new AST.Application(functionName('border'), [
|
352
|
|
- literalNode('#000000'),
|
353
|
|
- ]),
|
354
|
|
- ]
|
|
350
|
+ [new AST.Application(functionName('border'), [literalNode('#000000')])]
|
355
|
351
|
)
|
356
|
|
- )
|
|
352
|
+ );
|
357
|
353
|
}
|
358
|
354
|
});
|
359
|
355
|
|
|
@@ -369,13 +365,39 @@ test('parse mixin with children', (t) => {
|
369
|
365
|
[],
|
370
|
366
|
[
|
371
|
367
|
new AST.RuleSet(
|
372
|
|
- [
|
373
|
|
- new AST.Selector(literalToken('div')),
|
374
|
|
- ],
|
|
368
|
+ [new AST.Selector(literalToken('div'))],
|
375
|
369
|
[new AST.Rule(property('color'), literalNode('blue'))]
|
376
|
|
- )
|
|
370
|
+ ),
|
377
|
371
|
]
|
378
|
|
- ),
|
379
|
|
- )
|
|
372
|
+ )
|
|
373
|
+ );
|
|
374
|
+ }
|
|
375
|
+});
|
|
376
|
+
|
|
377
|
+test('media query as child', (t) => {
|
|
378
|
+ t.plan(2);
|
|
379
|
+ const result = parse('(div (@media :min-width 1000px (& :color blue)))');
|
|
380
|
+ t.false(result instanceof ParserError);
|
|
381
|
+ if (!(result instanceof LexerError) && !(result instanceof ParserError)) {
|
|
382
|
+ t.deepEqual(
|
|
383
|
+ result.tree[0],
|
|
384
|
+ new AST.RuleSet(
|
|
385
|
+ [new AST.Selector(literalToken('div'))],
|
|
386
|
+ [
|
|
387
|
+ new AST.MediaQuery(
|
|
388
|
+ new AST.MediaQueryPredicate(
|
|
389
|
+ property('min-width'),
|
|
390
|
+ literalNode('1000px')
|
|
391
|
+ ),
|
|
392
|
+ [
|
|
393
|
+ new AST.RuleSet(
|
|
394
|
+ [new AST.Selector(literalToken('&'))],
|
|
395
|
+ [new AST.Rule(property('color'), literalNode('blue'))]
|
|
396
|
+ ),
|
|
397
|
+ ]
|
|
398
|
+ ),
|
|
399
|
+ ]
|
|
400
|
+ )
|
|
401
|
+ );
|
380
|
402
|
}
|
381
|
403
|
});
|