File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ describe('default configuration', function () {
19
19
expect ( config . getRateLimit ( ) ) . to . be . eql ( defaultSettings . rateLimit ) ;
20
20
expect ( config . getTLSKeyPemPath ( ) ) . to . be . eql ( defaultSettings . tls . key ) ;
21
21
expect ( config . getTLSCertPemPath ( ) ) . to . be . eql ( defaultSettings . tls . cert ) ;
22
+ expect ( config . getTLSEnabled ( ) ) . to . be . eql ( defaultSettings . tls . enabled ) ;
23
+ expect ( config . getDomains ( ) ) . to . be . eql ( defaultSettings . domains ) ;
24
+ expect ( config . getURLShortener ( ) ) . to . be . eql ( defaultSettings . urlShortener ) ;
25
+ expect ( config . getContactEmail ( ) ) . to . be . eql ( defaultSettings . contactEmail ) ;
26
+ expect ( config . getPlugins ( ) ) . to . be . eql ( defaultSettings . plugins ) ;
27
+ expect ( config . getCSRFProtection ( ) ) . to . be . eql ( defaultSettings . csrfProtection ) ;
28
+ expect ( config . getAttestationConfig ( ) ) . to . be . eql ( defaultSettings . attestationConfig ) ;
29
+ expect ( config . getAPIs ( ) ) . to . be . eql ( defaultSettings . api ) ;
22
30
} ) ;
23
31
after ( function ( ) {
24
32
delete require . cache [ require . resolve ( '../src/config' ) ] ;
@@ -228,6 +236,21 @@ describe('user configuration', function () {
228
236
expect ( config . getTLSEnabled ( ) ) . to . be . eql ( false ) ;
229
237
} ) ;
230
238
239
+ it ( 'should override default settings for api' , function ( ) {
240
+ const user = {
241
+ api : {
242
+ gitlab : {
243
+ baseUrl : 'https://gitlab.com' ,
244
+ } ,
245
+ } ,
246
+ } ;
247
+ fs . writeFileSync ( tempUserFile , JSON . stringify ( user ) ) ;
248
+
249
+ const config = require ( '../src/config' ) ;
250
+
251
+ expect ( config . getAPIs ( ) ) . to . be . eql ( user . api ) ;
252
+ } ) ;
253
+
231
254
afterEach ( function ( ) {
232
255
fs . rmSync ( tempUserFile ) ;
233
256
fs . rmdirSync ( tempDir ) ;
You can’t perform that action at this time.
0 commit comments