Skip to content

Commit

Permalink
fix: remove NODE_ENV variable by default (#114)
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

The default for Environment Deletions setting changed from `[]` to `["NODE_ENV"]`

To restore previous behavior change the setting to `[]`
  • Loading branch information
UziTech authored Jul 15, 2020
1 parent e8bdd61 commit 66a9a86
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/config-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('Call to setEnv()', () => {

describe('Call to deleteEnv()', () => {
it('return []', () => {
expect(configDefaults.deleteEnv).toBe('[]')
expect(configDefaults.deleteEnv).toBe('["NODE_ENV"]')
})
})

Expand Down
8 changes: 7 additions & 1 deletion spec/element-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,13 @@ describe('XTerminalElement', () => {
})

it('getEnv()', () => {
expect(JSON.stringify(this.element.getEnv())).toEqual(JSON.stringify(process.env))
const NODE_ENV = process.env.NODE_ENV
try {
delete process.env.NODE_ENV
expect(JSON.stringify(this.element.getEnv())).toEqual(JSON.stringify(process.env))
} finally {
process.env.NODE_ENV = NODE_ENV
}
})

it('getEnv() env set in uri', async () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/profiles-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('XTerminalProfilesSingleton', () => {
projectCwd: true,
env: null,
setEnv: {},
deleteEnv: [],
deleteEnv: ['NODE_ENV'],
encoding: null,
fontSize: 14,
fontFamily: 'monospace',
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function resetConfigDefaults () {
webLinks: true,
env: '',
setEnv: '{}',
deleteEnv: '[]',
deleteEnv: '["NODE_ENV"]',
encoding: '',
fontSize: 14,
// NOTE: Atom will crash if the font is set below 8.
Expand Down

0 comments on commit 66a9a86

Please sign in to comment.