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 () {
1919 expect ( config . getRateLimit ( ) ) . to . be . eql ( defaultSettings . rateLimit ) ;
2020 expect ( config . getTLSKeyPemPath ( ) ) . to . be . eql ( defaultSettings . tls . key ) ;
2121 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 ) ;
2230 } ) ;
2331 after ( function ( ) {
2432 delete require . cache [ require . resolve ( '../src/config' ) ] ;
@@ -228,6 +236,21 @@ describe('user configuration', function () {
228236 expect ( config . getTLSEnabled ( ) ) . to . be . eql ( false ) ;
229237 } ) ;
230238
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+
231254 afterEach ( function ( ) {
232255 fs . rmSync ( tempUserFile ) ;
233256 fs . rmdirSync ( tempDir ) ;
You can’t perform that action at this time.
0 commit comments