You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it(`suggest other flags when there is flag explicitly enabled`,()=>{
563
+
constresponse=handleFlags(
564
+
[
565
+
{
566
+
name: `ENABLED_FLAG`,
567
+
env: `GATSBY_ENABLED_FLAG`,
568
+
command: `all`,
569
+
description: `test`,
570
+
umbrellaIssue: `test`,
571
+
telemetryId: `test`,
572
+
experimental: false,
573
+
testFitness: (): fitnessEnum=>true,
574
+
},
575
+
{
576
+
name: `OTHER_FLAG`,
577
+
env: `GATSBY_OTHER_FLAG`,
578
+
command: `all`,
579
+
description: `test`,
580
+
umbrellaIssue: `test`,
581
+
telemetryId: `test`,
582
+
experimental: false,
583
+
testFitness: (): fitnessEnum=>true,
584
+
},
585
+
],
586
+
{
587
+
ENABLED_FLAG: true,
588
+
},
589
+
`build`
590
+
)
591
+
592
+
expect(response.message).toMatchInlineSnapshot(`
593
+
"The following flags are active:
594
+
- ENABLED_FLAG · (Umbrella Issue (test)) · test
595
+
596
+
There is one other flag available that you might be interested in:
597
+
- OTHER_FLAG · (Umbrella Issue (test)) · test
598
+
"
599
+
`)
600
+
})
601
+
602
+
it(`suggest other flags when there is opted-in flag`,()=>{
603
+
constresponse=handleFlags(
604
+
[
605
+
{
606
+
name: `OPTED_IN_FLAG`,
607
+
env: `GATSBY_OPTED_IN_FLAG`,
608
+
command: `all`,
609
+
description: `test`,
610
+
umbrellaIssue: `test`,
611
+
telemetryId: `test`,
612
+
experimental: false,
613
+
testFitness: (): fitnessEnum=>`OPT_IN`,
614
+
},
615
+
{
616
+
name: `OTHER_FLAG`,
617
+
env: `GATSBY_OTHER_FLAG`,
618
+
command: `all`,
619
+
description: `test`,
620
+
umbrellaIssue: `test`,
621
+
telemetryId: `test`,
622
+
experimental: false,
623
+
testFitness: (): fitnessEnum=>true,
624
+
},
625
+
],
626
+
{},
627
+
`build`
628
+
)
629
+
630
+
expect(response.message).toMatchInlineSnapshot(`
631
+
"We're shipping new features! For final testing, we're rolling them out first to a small % of Gatsby users
632
+
and your site was automatically chosen as one of them. With your help, we'll then release them to everyone in the next minor release.
633
+
634
+
We greatly appreciate your help testing the change. Please report any feedback good or bad in the umbrella issue. If you do encounter problems, please disable the flag by setting it to false in your gatsby-config.js like:
635
+
636
+
flags: {
637
+
THE_FLAG: false
638
+
}
639
+
640
+
The following flags were automatically enabled on your site:
641
+
- OPTED_IN_FLAG · (Umbrella Issue (test)) · test
642
+
643
+
There is one other flag available that you might be interested in:
644
+
- OTHER_FLAG · (Umbrella Issue (test)) · test
645
+
"
646
+
`)
647
+
})
648
+
649
+
it(`doesn't suggest other flags if there are no enabled or opted in flags (no locked-in flags)`,()=>{
0 commit comments