Skip to content

Commit

Permalink
Add config.test.ts comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Nov 19, 2024
1 parent 592840d commit e099365
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import * as env from '../src/config/env.config'

describe('Test configuration options', () => {
it('should test configuration options', async () => {
// test success (found and required)
const SMTP_HOST = env.__env__('BC_SMTP_HOST', true)
expect(!!SMTP_HOST).toBeTruthy()

// test failure (not found and required)
let res = true
try {
const UNKNOWN = env.__env__('BC_UNKNOWN', true)
Expand All @@ -15,9 +17,11 @@ describe('Test configuration options', () => {
}
expect(res).toBeFalsy()

// test success (found and optional)
const PORT = env.__env__('BC_PORT', false, '4002')
expect(!!PORT).toBeTruthy()

// test success (not found and optional)
const UNKNOWN = env.__env__('BC_UNKNOWN', false)
expect(!!UNKNOWN).toBeFalsy()
})
Expand Down

0 comments on commit e099365

Please sign in to comment.