react-native-dotenv
Advanced tools
Comparing version 2.5.1 to 2.5.3
@@ -59,2 +59,7 @@ const {transformFileSync} = require('@babel/core') | ||
it('should load local env files', () => { | ||
const {code} = transformFileSync(FIXTURES + 'local-env/source.js') | ||
expect(code).toBe('console.log("local-key");\nconsole.log("username123456");') | ||
}) | ||
it('should support `as alias` import syntax', () => { | ||
@@ -70,2 +75,7 @@ const {code} = transformFileSync(FIXTURES + 'as-alias/source.js') | ||
it('should allow specifying the package module name', () => { | ||
const {code} = transformFileSync(FIXTURES + 'module-name/source.js') | ||
expect(code).toBe('// eslint-disable-next-line import/no-unresolved\nconsole.log("abc123");\nconsole.log("username");') | ||
}) | ||
it('should leave other imports untouched', () => { | ||
@@ -72,0 +82,0 @@ const {code} = transformFileSync(FIXTURES + 'unused/source.js') |
@@ -39,5 +39,10 @@ const {readFileSync} = require('fs') | ||
const modeParsed = parseDotenvFile(this.opts.path + '.' + babelMode) | ||
this.env = Object.assign(parsed, modeParsed) | ||
const localParsed = parseDotenvFile(this.opts.path + '.local') | ||
this.env = Object.assign(Object.assign(parsed, modeParsed), localParsed) | ||
} else { | ||
dotenv.config({ | ||
path: this.opts.path + '.local', | ||
silent: true | ||
}) | ||
dotenv.config({ | ||
path: this.opts.path + '.' + babelMode, | ||
@@ -44,0 +49,0 @@ silent: true |
{ | ||
"name": "react-native-dotenv", | ||
"version": "2.5.1", | ||
"version": "2.5.3", | ||
"description": "Load environment variables using import statements.", | ||
@@ -24,3 +24,3 @@ "repository": "github:goatandsheep/react-native-dotenv", | ||
"devDependencies": { | ||
"@babel/core": "7.12.10", | ||
"@babel/core": "7.12.13", | ||
"codecov": "^3.8.1", | ||
@@ -27,0 +27,0 @@ "jest": "26.6.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28531
71
224