@@ -14,7 +14,7 @@ test("checkSameOrgToolSpec same org", () => {
14
14
tool3 = { source = "org1/tool3", version = "1.0.0" }\n
15
15
` ;
16
16
let manifestContent = parse ( config ) ;
17
- expect ( configFile . checkSameOrgToolSpecs ( manifestContent , "org1" ) ) . toEqual (
17
+ expect ( configFile . checkSameOrgToolSpecs ( manifestContent , "org1" , [ ] ) ) . toEqual (
18
18
true
19
19
) ;
20
20
} ) ;
@@ -27,11 +27,36 @@ test("checkSameOrgToolSpec different org", () => {
27
27
tool3 = { source = "org1/tool3", version = "1.0.0" }\n
28
28
` ;
29
29
let manifestContent = parse ( config ) ;
30
- expect ( configFile . checkSameOrgToolSpecs ( manifestContent , "org1" ) ) . toEqual (
30
+ expect ( configFile . checkSameOrgToolSpecs ( manifestContent , "org1" , [ ] ) ) . toEqual (
31
31
false
32
32
) ;
33
33
} ) ;
34
34
35
+ test ( "checkSameOrgToolSpec external org allowed with allowList" , ( ) => {
36
+ let config = `
37
+ [tools]\n
38
+ tool1 = { source = "org1/tool1", version = "1.0.0" }\n
39
+ tool2 = { source = "org2/tool2", version = "1.0.0" }\n
40
+ tool3 = { source = "org1/tool3", version = "1.0.0" }\n
41
+ ` ;
42
+ let manifestContent = parse ( config ) ;
43
+ expect (
44
+ configFile . checkSameOrgToolSpecs ( manifestContent , "org1" , [ "org2" ] )
45
+ ) . toEqual ( true ) ;
46
+ } ) ;
47
+
48
+ test ( "checkSameOrgToolSpec external org allowed case-insensitive" , ( ) => {
49
+ let config = `
50
+ [tools]\n
51
+ tool1 = { source = "org1/tool1", version = "1.0.0" }\n
52
+ tool2 = { source = "ORG2/tool2", version = "1.0.0" }\n
53
+ ` ;
54
+ let manifestContent = parse ( config ) ;
55
+ expect (
56
+ configFile . checkSameOrgToolSpecs ( manifestContent , "org1" , [ "org2" ] )
57
+ ) . toEqual ( true ) ;
58
+ } ) ;
59
+
35
60
test ( "filter valid releases" , ( ) => {
36
61
const releases : GitHubRelease [ ] = [
37
62
{
0 commit comments