1- import { Transform , Parse , Tag , Type , RefEvent , DefaultPriorities } from '../src/tag' ;
1+ import { Transform , Parse , Tag , Type , RefEvent , ShaFormat , DefaultPriorities } from '../src/tag' ;
22
33describe ( 'transform' , ( ) => {
44 // prettier-ignore
@@ -89,7 +89,8 @@ describe('transform', () => {
8989 attrs : {
9090 "priority" : DefaultPriorities [ Type . Sha ] ,
9191 "enable" : "true" ,
92- "prefix" : "sha-"
92+ "prefix" : "sha-" ,
93+ "format" : ShaFormat . Short
9394 }
9495 }
9596 ] as Tag [ ] ,
@@ -355,7 +356,21 @@ describe('parse', () => {
355356 attrs : {
356357 "priority" : DefaultPriorities [ Type . Sha ] ,
357358 "enable" : "true" ,
358- "prefix" : "sha-"
359+ "prefix" : "sha-" ,
360+ "format" : ShaFormat . Short
361+ }
362+ } as Tag ,
363+ false
364+ ] ,
365+ [
366+ `type=sha,format=long` ,
367+ {
368+ type : Type . Sha ,
369+ attrs : {
370+ "priority" : DefaultPriorities [ Type . Sha ] ,
371+ "enable" : "true" ,
372+ "prefix" : "sha-" ,
373+ "format" : ShaFormat . Long
359374 }
360375 } as Tag ,
361376 false
@@ -367,7 +382,8 @@ describe('parse', () => {
367382 attrs : {
368383 "priority" : DefaultPriorities [ Type . Sha ] ,
369384 "enable" : "true" ,
370- "prefix" : ""
385+ "prefix" : "" ,
386+ "format" : ShaFormat . Short
371387 }
372388 } as Tag ,
373389 false
@@ -379,7 +395,8 @@ describe('parse', () => {
379395 attrs : {
380396 "priority" : DefaultPriorities [ Type . Sha ] ,
381397 "enable" : "false" ,
382- "prefix" : "sha-"
398+ "prefix" : "sha-" ,
399+ "format" : ShaFormat . Short
383400 }
384401 } as Tag ,
385402 false
@@ -403,6 +420,11 @@ describe('parse', () => {
403420 `type=sha,enable=foo` ,
404421 { } as Tag ,
405422 true
423+ ] ,
424+ [
425+ `type=sha,format=foo` ,
426+ { } as Tag ,
427+ true
406428 ]
407429 ] ) ( 'given %p event ' , async ( s : string , expected : Tag , invalid : boolean ) => {
408430 try {
0 commit comments