-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote branch 'origin/master' into edge
- Loading branch information
Showing
15 changed files
with
526 additions
and
377 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import assert from 'assert'; | ||
import { suite, test } from 'mocha'; | ||
import { setTerminalEnvironment } from '../../../src/helpers'; | ||
|
||
suite('Environment init', () => { | ||
test('Env init', () => { | ||
/** | ||
* We want to test the cases [existing variable, non-existing variable] | ||
* x [null value, empty string, non-empty string] exhaustively. So we | ||
* should end up with 6 test cases. | ||
*/ | ||
|
||
const targetEnv = { | ||
VAR1: '', | ||
VAR2: '', | ||
VAR3: '', | ||
VAR7: 'Should be preserved', | ||
}; | ||
|
||
const userEnv: { [name: string]: string | null } = { | ||
// Existing variables | ||
VAR1: null, | ||
VAR2: '', | ||
VAR3: 'Some new value', | ||
// Non-existing variables | ||
VAR4: null, | ||
VAR5: '', | ||
VAR6: 'Some other value', | ||
}; | ||
|
||
setTerminalEnvironment(targetEnv, userEnv); | ||
|
||
const expected = { | ||
VAR2: '', | ||
VAR3: 'Some new value', | ||
VAR5: '', | ||
VAR6: 'Some other value', | ||
VAR7: 'Should be preserved', | ||
}; | ||
|
||
assert.deepEqual(targetEnv, expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.