Skip to content

Commit

Permalink
feat: update packages and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Dec 7, 2021
1 parent 0aff88b commit e3bcae2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 106 deletions.
107 changes: 16 additions & 91 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@secjs/config",
"version": "1.1.2",
"version": "1.1.3",
"description": "",
"license": "MIT",
"author": "João Lenon",
Expand All @@ -20,9 +20,9 @@
],
"devDependencies": {
"@secjs/contracts": "1.1.7",
"@secjs/env": "1.2.5",
"@secjs/env": "1.2.8",
"@secjs/exceptions": "1.0.4",
"@secjs/utils": "1.4.3",
"@secjs/utils": "1.5.8",
"@types/debug": "4.1.5",
"@types/jest": "27.0.1",
"@types/node": "14.17.0",
Expand Down
3 changes: 0 additions & 3 deletions src/utils/global.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Path } from '@secjs/utils'
import { Config as ConfigInstance } from '../Config'

export {}
Expand All @@ -15,8 +14,6 @@ declare global {

const _global = global as any

Path.switchEnvVerify()

new ConfigInstance().loadIfUnloaded()

_global.Config = ConfigInstance
9 changes: 0 additions & 9 deletions tests/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,4 @@ describe('\n Config', () => {
expect(Config.get('DB_NAME')).toBe('testing')
expect(Config.get('database.dbName')).toBe('testing')
})

it('should be able to use loadIfUnloaded method to load configs if they are not loaded', async () => {
expect(Config.get('app')).toBe(undefined)

new Config().loadIfUnloaded()

expect(Config.get('DB_NAME')).toBe('testing')
expect(Config.get('database.dbName')).toBe('testing')
})
})

0 comments on commit e3bcae2

Please sign in to comment.