1- import { strict as assert } from " node:assert" ;
2- import { get_updated_label_set } from " ./autoLabel.js" ;
1+ import { strict as assert } from ' node:assert' ;
2+ import { get_updated_label_set } from ' ./autoLabel.js' ;
33
44const empty_pr = {
5- action : " opened" ,
5+ action : ' opened' ,
66 pull_request : {
7- body : " This PR will have no labels" ,
8- title : " Pr with no labels" ,
7+ body : ' This PR will have no labels' ,
8+ title : ' Pr with no labels' ,
99 mergeable : true ,
1010 } ,
1111} ;
1212const empty_label_set = await get_updated_label_set ( {
1313 github : null ,
1414 context : { payload : empty_pr } ,
1515} ) ;
16- assert . equal ( empty_label_set . length , 0 , " No labels should be added" ) ;
16+ assert . equal ( empty_label_set . length , 0 , ' No labels should be added' ) ;
1717
1818const cl = `
1919My Awesome PR
@@ -24,10 +24,10 @@ refactor: refactored some code
2424:/cl:
2525` ;
2626const cl_pr = {
27- action : " opened" ,
27+ action : ' opened' ,
2828 pull_request : {
2929 body : cl ,
30- title : " Awesome PR" ,
30+ title : ' Awesome PR' ,
3131 mergeable : false ,
3232 } ,
3333} ;
@@ -36,24 +36,24 @@ const cl_label_set = await get_updated_label_set({
3636 context : { payload : cl_pr } ,
3737} ) ;
3838assert . ok (
39- cl_label_set . includes ( "Конфликты" ) ,
40- " Merge Conflict label should be added"
39+ cl_label_set . includes ( 'Merge Conflict' ) ,
40+ ' Merge Conflict label should be added' ,
4141) ;
42- assert . ok ( cl_label_set . includes ( "Фишка" ) , " Feature label should be added" ) ;
42+ assert . ok ( cl_label_set . includes ( 'Feature' ) , ' Feature label should be added' ) ;
4343assert . ok (
44- ! cl_label_set . includes ( "Рефактор" ) ,
45- " Refactor label should not be added"
44+ ! cl_label_set . includes ( 'Refactor' ) ,
45+ ' Refactor label should not be added' ,
4646) ;
4747
4848const title_pr = {
49- action : " opened" ,
49+ action : ' opened' ,
5050 pull_request : {
51- title : " Logging is important" ,
51+ title : ' Logging is important' ,
5252 mergeable : true ,
5353 } ,
5454} ;
5555const title_label_set = await get_updated_label_set ( {
5656 github : null ,
5757 context : { payload : title_pr } ,
5858} ) ;
59- assert . ok ( title_label_set . includes ( " Logging" ) , " Logging label should be added" ) ;
59+ assert . ok ( title_label_set . includes ( ' Logging' ) , ' Logging label should be added' ) ;
0 commit comments