@@ -28,6 +28,8 @@ t.test('query-selector-all', async t => {
28
28
│ └── [email protected] (production dep of b, deduped)
29
29
├─┬ [email protected] (production dep of query-selector-all-tests)
30
30
│ └── [email protected] (production dep of bar)
31
+ |-┬ [email protected] -> ./c (workspace)
32
+ │ └── [email protected] (production dep of c, deduped)
31
33
├─┬ [email protected] (dev dep of query-selector-all-tests)
32
34
│ ├─┬ [email protected] (production dep of foo, deduped)
33
35
│ │ └── [email protected] (overridden peer dep of bar)
@@ -65,6 +67,9 @@ t.test('query-selector-all', async t => {
65
67
'1.0.0' : undefined ,
66
68
'1.0.1' : yesterday ,
67
69
} ,
70
+ c : {
71
+ '1.0.0' : today ,
72
+ } ,
68
73
'dash-separated-pkg' : {
69
74
'1.0.0' : dayBeforeYesterday ,
70
75
'2.0.0' : yesterday ,
@@ -173,6 +178,7 @@ t.test('query-selector-all', async t => {
173
178
} ,
174
179
} ) ,
175
180
} ,
181
+ c : t . fixture ( 'symlink' , '../c' ) ,
176
182
foo : {
177
183
node_modules : {
178
184
bar : {
@@ -275,10 +281,19 @@ t.test('query-selector-all', async t => {
275
281
bar : '^2.0.0' ,
276
282
} ,
277
283
} ) } ,
284
+ c : {
285
+ 'package.json' : JSON . stringify ( {
286
+ name : 'c' ,
287
+ version : '1.0.0' ,
288
+ dependencies : {
289
+ b : '^1.0.0' ,
290
+ } ,
291
+ } ) ,
292
+ } ,
278
293
'package.json' : JSON . stringify ( {
279
294
name : 'query-selector-all-tests' ,
280
295
version : '1.0.0' ,
281
- workspaces : [ 'a' , 'b' ] ,
296
+ workspaces : [ 'a' , 'b' , 'c' ] ,
282
297
dependencies : {
283
298
a : '^1.0.0' ,
284
299
abbrev : '^1.1.1' ,
@@ -387,6 +402,7 @@ t.test('query-selector-all', async t => {
387
402
388
403
389
404
405
+
390
406
391
407
392
408
@@ -404,6 +420,7 @@ t.test('query-selector-all', async t => {
404
420
[ '* > *' , [
405
421
406
422
423
+
407
424
408
425
409
426
@@ -425,18 +442,19 @@ t.test('query-selector-all', async t => {
425
442
[ ':root > *' , [
426
443
427
444
445
+
428
446
429
447
430
448
431
449
432
450
433
451
434
452
] ] ,
435
-
436
- [ ':root > *.workspace' , [ '[email protected] ' , '[email protected] ' ] ] ,
453
+
454
+
437
455
[ ':root > .workspace[name=a]' , [ '[email protected] ' ] ] ,
438
456
[ ':root > [name=bar]' , [ '[email protected] ' ] ] ,
439
- [ ':root > .workspace[version=1.0.0]' , [ '[email protected] ' , '[email protected] ' ] ] ,
457
+ [ ':root > .workspace[version=1.0.0]' , [ '[email protected] ' , '[email protected] ' , '[email protected] ' ] ] ,
440
458
[ ':root > .workspace[name=a][version=1.0.0]' , [ '[email protected] ' ] ] ,
441
459
[ ':root > :root' , [ ] ] ,
442
460
[ '* > :root' , [ ] ] ,
@@ -452,6 +470,7 @@ t.test('query-selector-all', async t => {
452
470
453
471
454
472
473
+
455
474
456
475
457
476
@@ -461,12 +480,12 @@ t.test('query-selector-all', async t => {
461
480
462
481
463
482
483
+
464
484
465
485
] ] ,
466
486
[ ':extraneous' , [ '@npmcli/[email protected] ' ] ] ,
467
487
[ ':invalid' , [ '[email protected] ' ] ] ,
468
-
469
-
488
+
470
489
[ ':deduped' , [
471
490
472
491
@@ -481,6 +500,7 @@ t.test('query-selector-all', async t => {
481
500
482
501
483
502
503
+
484
504
485
505
486
506
@@ -494,34 +514,36 @@ t.test('query-selector-all', async t => {
494
514
495
515
496
516
] ] ,
497
- [ ':root > .workspace:not(#b)' , [ '[email protected] ' ] ] ,
498
- [ ':root > .workspace > *:not(#bar)' , [ '[email protected] ' , '[email protected] ' ] ] ,
517
+ [ ':root > .workspace:not(#b)' , [ '[email protected] ' , '[email protected] ' ] ] ,
518
+ [ ':root > .workspace > *:not(#bar)' , [ '[email protected] ' , '[email protected] ' , ' [email protected] '] ] ,
499
519
[ '.bundled ~ :not(.workspace)' , [
500
520
501
521
502
522
503
523
504
524
505
525
] ] ,
506
- [ '*:root > *:empty:not(*[name^=a], #b)' , [ '[email protected] ' ] ] ,
526
+ [ '*:root > *:empty:not(*[name^=a], #b, #c )' , [ '[email protected] ' ] ] ,
507
527
[ ':not(:not(:link))' , [
508
528
509
529
530
+
510
531
] ] ,
511
532
512
533
// has pseudo
513
534
[ ':root > *:has(* > #bar:semver(1.4.0))' , [ '[email protected] ' ] ] ,
514
535
[ '*:has(* > #bar:semver(1.4.0))' , [ '[email protected] ' ] ] ,
515
536
[ '*:has(> #bar:semver(1.4.0))' , [ '[email protected] ' ] ] ,
516
537
[ '.workspace:has(> * > #lorem)' , [ '[email protected] ' ] ] ,
517
- [ '.workspace:has(* #lorem, ~ #b)' , [ '[email protected] ' , '[email protected] ' ] ] ,
538
+
518
539
519
540
// is pseudo
520
541
521
542
// TODO: ipsum is not empty but its child is missing so it doesn't return a
522
543
// result here
523
544
[ ':root > *:is(.prod:not(:empty), .dev > [name=bar]) > *' , [
524
545
546
+
525
547
526
548
527
549
@@ -538,6 +560,7 @@ t.test('query-selector-all', async t => {
538
560
539
561
540
562
563
+
541
564
542
565
543
566
@@ -557,6 +580,7 @@ t.test('query-selector-all', async t => {
557
580
[ ':type(range)' , [
558
581
559
582
583
+
560
584
561
585
562
586
@@ -584,11 +608,12 @@ t.test('query-selector-all', async t => {
584
608
[ ':path(./node_modules/bar)' , [ '[email protected] ' ] ] ,
585
609
[ ':path(node_modules/foo/node_modules/bar)' , [ '[email protected] ' ] ] ,
586
610
587
-
611
+
588
612
[ ':path()' , [
589
613
590
614
591
615
616
+
592
617
593
618
594
619
@@ -609,6 +634,7 @@ t.test('query-selector-all', async t => {
609
634
610
635
611
636
637
+
612
638
613
639
614
640
@@ -627,6 +653,7 @@ t.test('query-selector-all', async t => {
627
653
628
654
629
655
656
+
630
657
631
658
632
659
@@ -690,6 +717,7 @@ t.test('query-selector-all', async t => {
690
717
691
718
692
719
720
+
693
721
694
722
695
723
@@ -702,6 +730,7 @@ t.test('query-selector-all', async t => {
702
730
703
731
704
732
733
+
705
734
706
735
707
736
@@ -720,6 +749,7 @@ t.test('query-selector-all', async t => {
720
749
721
750
722
751
752
+
723
753
724
754
725
755
@@ -731,6 +761,7 @@ t.test('query-selector-all', async t => {
731
761
732
762
733
763
764
+
734
765
735
766
736
767
@@ -832,6 +863,7 @@ t.test('query-selector-all', async t => {
832
863
833
864
834
865
866
+
835
867
836
868
837
869
@@ -882,15 +914,18 @@ t.test('query-selector-all', async t => {
882
914
883
915
884
916
917
+
885
918
886
919
887
920
888
921
889
922
890
923
891
924
] ] ,
892
-
893
-
925
+
926
+
927
+ [ '.workspace .workspace' , [ '[email protected] ' , '[email protected] ' ] ] ,
928
+ [ '.workspace .workspace .workspace' , [ '[email protected] ' ] ] ,
894
929
[ '.workspace ~ *' , [
895
930
896
931
@@ -911,9 +946,11 @@ t.test('query-selector-all', async t => {
911
946
912
947
] ] ,
913
948
[ '.dev *' , [
949
+
914
950
915
951
916
952
953
+
917
954
918
955
919
956
] ] ,
@@ -923,6 +960,7 @@ t.test('query-selector-all', async t => {
923
960
[ '.bundled ~ *' , [
924
961
925
962
963
+
926
964
927
965
928
966
0 commit comments