@@ -11,8 +11,8 @@ describe("nexus-repository", async () => {
11
11
12
12
testRequiredVariables ( import . meta. dir , {
13
13
agent_id : "test-agent" ,
14
- nexus_url : "https://nexus.example.com" ,
15
- nexus_password : "test-password"
14
+ nexus_url : "https://nexus.example.com" ,
15
+ nexus_password : "test-password" ,
16
16
} ) ;
17
17
18
18
it ( "configures Maven settings" , async ( ) => {
@@ -21,8 +21,8 @@ describe("nexus-repository", async () => {
21
21
nexus_url : "https://nexus.example.com" ,
22
22
nexus_password : "test-token" ,
23
23
package_managers : JSON . stringify ( {
24
- maven : [ "maven-public" ]
25
- } )
24
+ maven : [ "maven-public" ] ,
25
+ } ) ,
26
26
} ) ;
27
27
28
28
const output = await executeScriptInContainer ( state , "ubuntu:20.04" ) ;
@@ -33,11 +33,11 @@ describe("nexus-repository", async () => {
33
33
it ( "configures npm registry" , async ( ) => {
34
34
const state = await runTerraformApply ( import . meta. dir , {
35
35
agent_id : "test-agent" ,
36
- nexus_url : "https://nexus.example.com" ,
36
+ nexus_url : "https://nexus.example.com" ,
37
37
nexus_password : "test-token" ,
38
38
package_managers : JSON . stringify ( {
39
- npm : [ "npm-public" ]
40
- } )
39
+ npm : [ "npm-public" ] ,
40
+ } ) ,
41
41
} ) ;
42
42
43
43
const output = await executeScriptInContainer ( state , "ubuntu:20.04" ) ;
@@ -49,10 +49,10 @@ describe("nexus-repository", async () => {
49
49
const state = await runTerraformApply ( import . meta. dir , {
50
50
agent_id : "test-agent" ,
51
51
nexus_url : "https://nexus.example.com" ,
52
- nexus_password : "test-token" ,
52
+ nexus_password : "test-token" ,
53
53
package_managers : JSON . stringify ( {
54
- pypi : [ "pypi-public" ]
55
- } )
54
+ pypi : [ "pypi-public" ] ,
55
+ } ) ,
56
56
} ) ;
57
57
58
58
const output = await executeScriptInContainer ( state , "ubuntu:20.04" ) ;
@@ -67,31 +67,41 @@ describe("nexus-repository", async () => {
67
67
nexus_password : "test-token" ,
68
68
package_managers : JSON . stringify ( {
69
69
maven : [ "maven-public" ] ,
70
- npm : [ "npm-public" ] ,
71
- pypi : [ "pypi-public" ]
72
- } )
70
+ npm : [ "npm-public" ] ,
71
+ pypi : [ "pypi-public" ] ,
72
+ } ) ,
73
73
} ) ;
74
74
75
75
const output = await executeScriptInContainer ( state , "ubuntu:20.04" ) ;
76
76
expect ( output . stdout . join ( "\n" ) ) . toContain ( "☕ Configuring Maven..." ) ;
77
77
expect ( output . stdout . join ( "\n" ) ) . toContain ( "📦 Configuring npm..." ) ;
78
78
expect ( output . stdout . join ( "\n" ) ) . toContain ( "🐍 Configuring pip..." ) ;
79
- expect ( output . stdout . join ( "\n" ) ) . toContain ( "✅ Nexus repository configuration completed!" ) ;
79
+ expect ( output . stdout . join ( "\n" ) ) . toContain (
80
+ "✅ Nexus repository configuration completed!" ,
81
+ ) ;
80
82
} ) ;
81
83
82
84
it ( "handles empty package managers" , async ( ) => {
83
85
const state = await runTerraformApply ( import . meta. dir , {
84
86
agent_id : "test-agent" ,
85
87
nexus_url : "https://nexus.example.com" ,
86
88
nexus_password : "test-token" ,
87
- package_managers : JSON . stringify ( { } )
89
+ package_managers : JSON . stringify ( { } ) ,
88
90
} ) ;
89
91
90
92
const output = await executeScriptInContainer ( state , "ubuntu:20.04" ) ;
91
- expect ( output . stdout . join ( "\n" ) ) . toContain ( "🤔 no maven repository is set, skipping maven configuration." ) ;
92
- expect ( output . stdout . join ( "\n" ) ) . toContain ( "🤔 no npm repository is set, skipping npm configuration." ) ;
93
- expect ( output . stdout . join ( "\n" ) ) . toContain ( "🤔 no pypi repository is set, skipping pypi configuration." ) ;
94
- expect ( output . stdout . join ( "\n" ) ) . toContain ( "🤔 no docker repository is set, skipping docker configuration." ) ;
93
+ expect ( output . stdout . join ( "\n" ) ) . toContain (
94
+ "🤔 no maven repository is set, skipping maven configuration." ,
95
+ ) ;
96
+ expect ( output . stdout . join ( "\n" ) ) . toContain (
97
+ "🤔 no npm repository is set, skipping npm configuration." ,
98
+ ) ;
99
+ expect ( output . stdout . join ( "\n" ) ) . toContain (
100
+ "🤔 no pypi repository is set, skipping pypi configuration." ,
101
+ ) ;
102
+ expect ( output . stdout . join ( "\n" ) ) . toContain (
103
+ "🤔 no docker repository is set, skipping docker configuration." ,
104
+ ) ;
95
105
} ) ;
96
106
97
107
it ( "configures Go module proxy" , async ( ) => {
@@ -100,13 +110,15 @@ describe("nexus-repository", async () => {
100
110
nexus_url : "https://nexus.example.com" ,
101
111
nexus_password : "test-token" ,
102
112
package_managers : JSON . stringify ( {
103
- go : [ "go-public" , "go-private" ]
104
- } )
113
+ go : [ "go-public" , "go-private" ] ,
114
+ } ) ,
105
115
} ) ;
106
116
107
117
const output = await executeScriptInContainer ( state , "ubuntu:20.04" ) ;
108
118
expect ( output . stdout . join ( "\n" ) ) . toContain ( "🐹 Configuring Go..." ) ;
109
- expect ( output . stdout . join ( "\n" ) ) . toContain ( "Go proxy configured via GOPROXY environment variable" ) ;
119
+ expect ( output . stdout . join ( "\n" ) ) . toContain (
120
+ "Go proxy configured via GOPROXY environment variable" ,
121
+ ) ;
110
122
expect ( output . stdout . join ( "\n" ) ) . toContain ( "🥳 Configuration complete!" ) ;
111
123
} ) ;
112
124
@@ -116,20 +128,20 @@ describe("nexus-repository", async () => {
116
128
agent_id : "test-agent" ,
117
129
nexus_url : "invalid-url" ,
118
130
nexus_password : "test-token" ,
119
- package_managers : JSON . stringify ( { } )
120
- } )
131
+ package_managers : JSON . stringify ( { } ) ,
132
+ } ) ,
121
133
) . rejects . toThrow ( ) ;
122
134
} ) ;
123
135
124
136
it ( "validates username_field values" , async ( ) => {
125
137
await expect (
126
138
runTerraformApply ( import . meta. dir , {
127
- agent_id : "test-agent" ,
139
+ agent_id : "test-agent" ,
128
140
nexus_url : "https://nexus.example.com" ,
129
141
nexus_password : "test-token" ,
130
142
username_field : "invalid" ,
131
- package_managers : JSON . stringify ( { } )
132
- } )
143
+ package_managers : JSON . stringify ( { } ) ,
144
+ } ) ,
133
145
) . rejects . toThrow ( ) ;
134
146
} ) ;
135
- } ) ;
147
+ } ) ;
0 commit comments