@@ -21,12 +21,22 @@ describe('labels.js — default exports', () => {
2121
2222 beforeEach ( ( ) => {
2323 // Clear any env overrides from previous tests
24+ delete process . env . GOOD_FIRST_ISSUE_LABEL ;
25+ delete process . env . GOOD_FIRST_ISSUE_CANDIDATE_LABEL ;
2426 delete process . env . BEGINNER_LABEL ;
2527 delete process . env . INTERMEDIATE_LABEL ;
2628 delete process . env . ADVANCED_LABEL ;
2729 labels = freshRequire ( ) ;
2830 } ) ;
2931
32+ it ( 'exports correct default GOOD_FIRST_ISSUE_LABEL' , ( ) => {
33+ assert . equal ( labels . GOOD_FIRST_ISSUE_LABEL , 'Good First Issue' ) ;
34+ } ) ;
35+
36+ it ( 'exports correct default GOOD_FIRST_ISSUE_CANDIDATE_LABEL' , ( ) => {
37+ assert . equal ( labels . GOOD_FIRST_ISSUE_CANDIDATE_LABEL , 'Good First Issue Candidate' ) ;
38+ } ) ;
39+
3040 it ( 'exports correct default BEGINNER_LABEL' , ( ) => {
3141 assert . equal ( labels . BEGINNER_LABEL , 'skill: beginner' ) ;
3242 } ) ;
@@ -39,24 +49,48 @@ describe('labels.js — default exports', () => {
3949 assert . equal ( labels . ADVANCED_LABEL , 'skill: advanced' ) ;
4050 } ) ;
4151
42- it ( 'exports DIFFICULTY_LABELS array with all three' , ( ) => {
43- assert . equal ( labels . DIFFICULTY_LABELS . length , 3 ) ;
52+ it ( 'exports DIFFICULTY_LABELS array with all four difficulty tiers' , ( ) => {
53+ assert . equal ( labels . DIFFICULTY_LABELS . length , 4 ) ;
54+ assert . ok ( labels . DIFFICULTY_LABELS . includes ( 'Good First Issue' ) ) ;
4455 assert . ok ( labels . DIFFICULTY_LABELS . includes ( 'skill: beginner' ) ) ;
4556 assert . ok ( labels . DIFFICULTY_LABELS . includes ( 'skill: intermediate' ) ) ;
4657 assert . ok ( labels . DIFFICULTY_LABELS . includes ( 'skill: advanced' ) ) ;
4758 } ) ;
59+
60+ it ( 'orders DIFFICULTY_LABELS by ascending difficulty' , ( ) => {
61+ assert . deepEqual ( labels . DIFFICULTY_LABELS , [
62+ 'Good First Issue' ,
63+ 'skill: beginner' ,
64+ 'skill: intermediate' ,
65+ 'skill: advanced' ,
66+ ] ) ;
67+ } ) ;
68+
69+ it ( 'does not include GOOD_FIRST_ISSUE_CANDIDATE_LABEL in DIFFICULTY_LABELS' , ( ) => {
70+ assert . ok ( ! labels . DIFFICULTY_LABELS . includes ( 'Good First Issue Candidate' ) ) ;
71+ } ) ;
4872} ) ;
4973
5074describe ( 'labels.js — isSafeLabel' , ( ) => {
5175 let isSafeLabel ;
5276
5377 beforeEach ( ( ) => {
78+ delete process . env . GOOD_FIRST_ISSUE_LABEL ;
79+ delete process . env . GOOD_FIRST_ISSUE_CANDIDATE_LABEL ;
5480 delete process . env . BEGINNER_LABEL ;
5581 delete process . env . INTERMEDIATE_LABEL ;
5682 delete process . env . ADVANCED_LABEL ;
5783 isSafeLabel = freshRequire ( ) . isSafeLabel ;
5884 } ) ;
5985
86+ it ( 'accepts "Good First Issue"' , ( ) => {
87+ assert . ok ( isSafeLabel ( 'Good First Issue' ) ) ;
88+ } ) ;
89+
90+ it ( 'accepts "Good First Issue Candidate"' , ( ) => {
91+ assert . ok ( isSafeLabel ( 'Good First Issue Candidate' ) ) ;
92+ } ) ;
93+
6094 it ( 'accepts "skill: beginner"' , ( ) => {
6195 assert . ok ( isSafeLabel ( 'skill: beginner' ) ) ;
6296 } ) ;
@@ -69,10 +103,6 @@ describe('labels.js — isSafeLabel', () => {
69103 assert . ok ( isSafeLabel ( 'skill: advanced' ) ) ;
70104 } ) ;
71105
72- it ( 'accepts "Good First Issue"' , ( ) => {
73- assert . ok ( isSafeLabel ( 'Good First Issue' ) ) ;
74- } ) ;
75-
76106 it ( 'accepts simple alphanumeric labels' , ( ) => {
77107 assert . ok ( isSafeLabel ( 'beginner' ) ) ;
78108 assert . ok ( isSafeLabel ( 'scope/CI' ) ) ;
@@ -102,6 +132,21 @@ describe('labels.js — isSafeLabel', () => {
102132} ) ;
103133
104134describe ( 'labels.js — environment variable overrides' , ( ) => {
135+ it ( 'overrides GOOD_FIRST_ISSUE_LABEL from env' , ( ) => {
136+ process . env . GOOD_FIRST_ISSUE_LABEL = 'custom: gfi' ;
137+ const labels = freshRequire ( ) ;
138+ assert . equal ( labels . GOOD_FIRST_ISSUE_LABEL , 'custom: gfi' ) ;
139+ assert . ok ( labels . DIFFICULTY_LABELS . includes ( 'custom: gfi' ) ) ;
140+ delete process . env . GOOD_FIRST_ISSUE_LABEL ;
141+ } ) ;
142+
143+ it ( 'overrides GOOD_FIRST_ISSUE_CANDIDATE_LABEL from env' , ( ) => {
144+ process . env . GOOD_FIRST_ISSUE_CANDIDATE_LABEL = 'custom: gfi candidate' ;
145+ const labels = freshRequire ( ) ;
146+ assert . equal ( labels . GOOD_FIRST_ISSUE_CANDIDATE_LABEL , 'custom: gfi candidate' ) ;
147+ delete process . env . GOOD_FIRST_ISSUE_CANDIDATE_LABEL ;
148+ } ) ;
149+
105150 it ( 'overrides BEGINNER_LABEL from env' , ( ) => {
106151 process . env . BEGINNER_LABEL = 'custom: beginner' ;
107152 const labels = freshRequire ( ) ;
0 commit comments