123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
-
- let lib = require('../src/lib')
-
- describe('lib end-to-end', function () {
- beforeEach(function () {
- })
-
- afterEach(function () {
- })
-
- describe('when parsing env variables', function () {
- it('should return empty map on null value', function () {
- expect(lib._parseEnvironmentVariables(null)).toEqual({})
- })
- it('should return empty map on undefined value', function () {
- expect(lib._parseEnvironmentVariables(undefined)).toEqual({})
- })
- describe('without simctl fix', function () {
- it('should return valid map for valid env variable', function () {
- expect(lib._parseEnvironmentVariables(['KEY=VALUE'], false)).toEqual({ 'KEY': 'VALUE' })
- })
- })
- describe('with simctl fix', function () {
- it('should add SIMCTL_CHILD_ prefix to all keys', function () {
- expect(lib._parseEnvironmentVariables(['KEY=VALUE', 'KEY2=VALUE2'], true))
- .toEqual(
- {
- 'SIMCTL_CHILD_KEY': 'VALUE',
- 'SIMCTL_CHILD_KEY2': 'VALUE2'
- }
- )
- })
- })
- })
-
- it('init should not process.exit when called as a lib', function () {
- let code = lib.init()
- expect(!isNaN(code)).toBe(true)
- })
- })
|