aboutsummaryrefslogtreecommitdiff
path: root/cordova/node_modules/ios-sim/spec/lib.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'cordova/node_modules/ios-sim/spec/lib.spec.js')
-rw-r--r--cordova/node_modules/ios-sim/spec/lib.spec.js58
1 files changed, 58 insertions, 0 deletions
diff --git a/cordova/node_modules/ios-sim/spec/lib.spec.js b/cordova/node_modules/ios-sim/spec/lib.spec.js
new file mode 100644
index 0000000..7fa0e88
--- /dev/null
+++ b/cordova/node_modules/ios-sim/spec/lib.spec.js
@@ -0,0 +1,58 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+var 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() {
+ var code = lib.init();
+ expect(!isNaN(code)).toBe(true);
+ });
+}); \ No newline at end of file