Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

frack-settings

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frack-settings - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

src/__tests__/.frackrc.js

9

package.json
{
"name": "frack-settings",
"version": "0.1.8",
"version": "0.1.9",
"description": "Settings defaults and runtime loader from rc file",

@@ -31,3 +31,3 @@ "license": "MIT",

"dev": "rollup -c -w",
"test": "cross-env APP_ENV=production jest --no-cache",
"test": "jest --no-cache",
"coverage": "npm test -- --coverage",

@@ -57,3 +57,6 @@ "postcoverage": "opn coverage/lcov-report/index.html",

"^.+\\.js?$": "babel-jest"
}
},
"testPathIgnorePatterns": [
".frackrc.js"
]
},

@@ -60,0 +63,0 @@ "keywords": [

import frackSettings from '../frackSettings'
it('should load settings', () => {
it('should load default settings', () => {
process.chdir(__dirname)
const settings = frackSettings()
expect(settings).not.toBeFalsy()
expect(settings.appMode).toBe('development') // from section development, cause development is the default PYČO!
expect(settings.redisPort).toBe(6380) // from section development, cause development is the default PYČO!
})
it('should load production settings', () => {
process.chdir(__dirname)
process.env.APP_ENV = 'production'
const settings = frackSettings()
expect(settings).not.toBeFalsy()
expect(settings.appMode).toBe('production') // from section production
expect(settings.redisPort).toBe(6381) // from section production
})
it('should load another settings', () => {
process.chdir(__dirname)
process.env.APP_ENV = 'someSection'
const settings = frackSettings()
expect(settings).not.toBeFalsy()
expect(settings.redisPort).toBe(6382) // from section production
})
it('should fail load non-existing section', () => {
process.chdir(__dirname)
process.env.APP_ENV = 'iDontExistDude'
expect(() => {
const settings = frackSettings() // eslint-disable-line no-unused-vars
}).toThrow()
})

@@ -42,3 +42,3 @@ /* eslint-disable global-require */

guards.checkAppEnv(settings, currentEnv)
return deepMerge(settings[currentEnv], settings.common)
return deepMerge(settings.common, settings[currentEnv])
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc