You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2017/01/17 17:31:41 UTC
[1/2] ios commit: CB-12018 :updated tests to function with jasmine
instead of jasmine-node
Repository: cordova-ios
Updated Branches:
refs/heads/master 6df46b7ba -> 32a9eca36
CB-12018 :updated tests to function with jasmine instead of jasmine-node
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/73a53115
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/73a53115
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/73a53115
Branch: refs/heads/master
Commit: 73a531151147d7f8f77df744bdcfc088ef673f7f
Parents: 6df46b7
Author: audreyso <au...@adobe.com>
Authored: Wed Dec 28 18:18:27 2016 -0800
Committer: audreyso <au...@adobe.com>
Committed: Wed Jan 11 18:09:34 2017 -0800
----------------------------------------------------------------------
package.json | 2 +-
tests/spec/create.spec.js | 16 +--
tests/spec/unit/Api.spec.js | 4 +-
tests/spec/unit/Plugman/common.spec.js | 28 +++---
tests/spec/unit/Plugman/pluginHandler.spec.js | 107 +++++++++++----------
tests/spec/unit/Podfile.spec.js | 20 ++--
tests/spec/unit/PodsJson.spec.js | 16 +--
tests/spec/unit/prepare.spec.js | 73 +++++++-------
tests/spec/unit/preparePlatform.spec.js | 6 +-
tests/spec/unit/projectFile.spec.js | 14 +--
10 files changed, 149 insertions(+), 137 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3f703ca..fb117bf 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,7 @@
"devDependencies": {
"coffee-script": "^1.7.1",
"istanbul": "^0.4.2",
- "jasmine-node": "~1",
+ "jasmine": "^2.5.2",
"jshint": "^2.6.0",
"nodeunit": "^0.8.7",
"rewire": "^2.5.1",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/create.spec.js b/tests/spec/create.spec.js
index 07a2bff..4c6e0d1 100644
--- a/tests/spec/create.spec.js
+++ b/tests/spec/create.spec.js
@@ -53,49 +53,49 @@ function createAndBuild(projectname, projectid) {
describe('create', function() {
- it('create project with ascii name, no spaces', function() {
+ it('Test#001 : create project with ascii name, no spaces', function() {
var projectname = 'testcreate';
var projectid = 'com.test.app1';
createAndBuild(projectname, projectid);
});
- it('create project with ascii name, and spaces', function() {
+ it('Test#002 : create project with ascii name, and spaces', function() {
var projectname = 'test create';
var projectid = 'com.test.app2';
createAndBuild(projectname, projectid);
});
- it('create project with unicode name, no spaces', function() {
+ it('Test#003 : create project with unicode name, no spaces', function() {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc\u7528\u7528\u7528\u7528';
var projectid = 'com.test.app3';
createAndBuild(projectname, projectid);
});
- it('create project with unicode name 2, no spaces', function() {
+ it('Test#004 : create project with unicode name 2, no spaces', function() {
var projectname = '\u0625\u062b\u0631\u0627';
var projectid = 'com.test.app3.2';
createAndBuild(projectname, projectid);
});
- it('create project with unicode name, and spaces', function() {
+ it('Test#005 : create project with unicode name, and spaces', function() {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc \u7528\u7528\u7528\u7528';
var projectid = 'com.test.app4';
createAndBuild(projectname, projectid);
});
- it('create project with ascii+unicode name, no spaces', function() {
+ it('Test#006 : create project with ascii+unicode name, no spaces', function() {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdchello\u7528\u7528\u7528\u7528';
var projectid = 'com.test.app5';
createAndBuild(projectname, projectid);
});
- it('create project with ascii+unicode name, and spaces', function() {
+ it('Test#007 : create project with ascii+unicode name, and spaces', function() {
var projectname = '\u5fdc\u5fdc\u5fdc\u5fdc hello \u7528\u7528\u7528\u7528';
var projectid = 'com.test.app6';
@@ -105,7 +105,7 @@ describe('create', function() {
});
describe('end-to-end list validation', function(){
- it('handles list parameter', function() {
+ it('Test#008 : handles list parameter', function() {
shell.cp('-f', path.join(cordova_bin, 'check_reqs'), path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'check_reqs'));
shell.cp('-f', path.join(cordova_bin, 'lib', 'check_reqs.js'), path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'lib', 'check_reqs.js'));
shell.cp('-f', path.join(cordova_bin, 'lib', 'versions.js'), path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'lib', 'versions.js'));
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/Api.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/Api.spec.js b/tests/spec/unit/Api.spec.js
index 9c25f59..facd507 100644
--- a/tests/spec/unit/Api.spec.js
+++ b/tests/spec/unit/Api.spec.js
@@ -25,10 +25,10 @@ var iosProjectFixture = path.join(FIXTURES, 'ios-config-xml');
describe('Platform Api', function () {
describe('constructor', function() {
- it('should throw if provided directory does not contain an xcodeproj file', function() {
+ it('Test 001 : should throw if provided directory does not contain an xcodeproj file', function() {
expect(function() { new Api('ios', path.join(FIXTURES, '..')); }).toThrow();
});
- it('should create an instance with path, pbxproj, xcodeproj, originalName and cordovaproj properties', function() {
+ it('Test 002 : should create an instance with path, pbxproj, xcodeproj, originalName and cordovaproj properties', function() {
expect(function() {
var p = new Api('ios',iosProjectFixture);
expect(p.locations.root).toEqual(iosProjectFixture);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/Plugman/common.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/Plugman/common.spec.js b/tests/spec/unit/Plugman/common.spec.js
index 58eb27b..7a0c344 100644
--- a/tests/spec/unit/Plugman/common.spec.js
+++ b/tests/spec/unit/Plugman/common.spec.js
@@ -40,13 +40,13 @@ var removeFileAndParents = common.__get__('removeFileAndParents');
describe('common handler routines', function() {
describe('copyFile', function() {
- it('should throw if source path not found', function(){
+ it('Test 001 : should throw if source path not found', function(){
shell.rm('-rf', test_dir);
expect(function(){copyFile(test_dir, src, project_dir, dest);}).
toThrow(new Error('"' + src + '" not found!'));
});
- it('should throw if src not in plugin directory', function(){
+ it('Test 002 : should throw if src not in plugin directory', function(){
shell.mkdir('-p', project_dir);
fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
var outside_file = '../non_plugin_file';
@@ -55,7 +55,7 @@ describe('common handler routines', function() {
shell.rm('-rf', test_dir);
});
- it('should allow symlink src, if inside plugin', function(){
+ it('Test 003 : should allow symlink src, if inside plugin', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
@@ -68,7 +68,7 @@ describe('common handler routines', function() {
shell.rm('-rf', project_dir);
});
- it('should throw if symlink is linked to a file outside the plugin', function(){
+ it('Test 004 : should throw if symlink is linked to a file outside the plugin', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
@@ -82,7 +82,7 @@ describe('common handler routines', function() {
shell.rm('-rf', project_dir);
});
- it('should throw if dest is outside the project directory', function(){
+ it('Test 005 : should throw if dest is outside the project directory', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
expect(function(){copyFile(test_dir, srcFile, project_dir, non_plugin_file);}).
@@ -90,11 +90,11 @@ describe('common handler routines', function() {
shell.rm('-rf', project_dir);
});
- it('should call mkdir -p on target path', function(){
+ it('Test 006 : should call mkdir -p on target path', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
- var s = spyOn(shell, 'mkdir').andCallThrough();
+ var s = spyOn(shell, 'mkdir').and.callThrough();
var resolvedDest = path.resolve(project_dir, dest);
copyFile(test_dir, srcFile, project_dir, dest);
@@ -104,11 +104,11 @@ describe('common handler routines', function() {
shell.rm('-rf', project_dir);
});
- it('should call cp source/dest paths', function(){
+ it('Test 007 : should call cp source/dest paths', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
- var s = spyOn(shell, 'cp').andCallThrough();
+ var s = spyOn(shell, 'cp').and.callThrough();
var resolvedDest = path.resolve(project_dir, dest);
copyFile(test_dir, srcFile, project_dir, dest);
@@ -122,7 +122,7 @@ describe('common handler routines', function() {
});
describe('copyNewFile', function () {
- it('should throw if target path exists', function(){
+ it('Test 008 : should throw if target path exists', function(){
shell.mkdir('-p', dest);
expect(function(){copyNewFile(test_dir, src, project_dir, dest);}).
toThrow(new Error('"' + dest + '" already exists!'));
@@ -132,11 +132,11 @@ describe('common handler routines', function() {
});
describe('deleteJava', function() {
- it('should call fs.unlinkSync on the provided paths', function(){
+ it('Test 009 : should call fs.unlinkSync on the provided paths', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
- var s = spyOn(fs, 'unlinkSync').andCallThrough();
+ var s = spyOn(fs, 'unlinkSync').and.callThrough();
removeFileAndParents(project_dir, srcFile);
expect(s).toHaveBeenCalled();
expect(s).toHaveBeenCalledWith(path.resolve(project_dir, srcFile));
@@ -144,7 +144,7 @@ describe('common handler routines', function() {
shell.rm('-rf', srcDirTree);
});
- it('should delete empty directories after removing source code in path hierarchy', function(){
+ it('Test 010 : should delete empty directories after removing source code in path hierarchy', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
@@ -156,7 +156,7 @@ describe('common handler routines', function() {
shell.rm('-rf', srcDirTree);
});
- it('should delete the top-level src directory if all plugins added were removed', function(){
+ it('Test 011 : should delete the top-level src directory if all plugins added were removed', function(){
shell.mkdir('-p', srcDirTree);
fs.writeFileSync(srcFile, 'contents', 'utf-8');
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/Plugman/pluginHandler.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/Plugman/pluginHandler.spec.js b/tests/spec/unit/Plugman/pluginHandler.spec.js
index 08282ff..5b2df77 100644
--- a/tests/spec/unit/Plugman/pluginHandler.spec.js
+++ b/tests/spec/unit/Plugman/pluginHandler.spec.js
@@ -87,13 +87,13 @@ describe('ios plugin handler', function() {
spyOn(dummyProject.xcode, 'addSourceFile');
});
- it('should throw if source-file src cannot be found', function() {
+ it('Test 001 : should throw if source-file src cannot be found', function() {
var source = copyArray(invalid_source);
expect(function() {
install(source[1], faultyPluginInfo, dummyProject);
}).toThrow();
});
- it('should throw if source-file target already exists', function() {
+ it('Test 002 : should throw if source-file target already exists', function() {
var source = copyArray(valid_source);
var target = path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.m');
shell.mkdir('-p', path.dirname(target));
@@ -102,31 +102,31 @@ describe('ios plugin handler', function() {
install(source[0], dummyPluginInfo, dummyProject);
}).toThrow();
});
- it('should call into xcodeproj\'s addSourceFile appropriately when element has no target-dir', function() {
+ it('Test 003 : should call into xcodeproj\'s addSourceFile appropriately when element has no target-dir', function() {
var source = copyArray(valid_source).filter(function(s) { return s.targetDir === undefined; });
install(source[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.addSourceFile)
.toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.m'), {});
});
- it('should call into xcodeproj\'s addSourceFile appropriately when element has a target-dir', function() {
+ it('Test 004 : should call into xcodeproj\'s addSourceFile appropriately when element has a target-dir', function() {
var source = copyArray(valid_source).filter(function(s) { return s.targetDir !== undefined; });
install(source[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.addSourceFile)
.toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'), {});
});
- it('should cp the file to the right target location when element has no target-dir', function() {
+ it('Test 005 : should cp the file to the right target location when element has no target-dir', function() {
var source = copyArray(valid_source).filter(function(s) { return s.targetDir === undefined; });
var spy = spyOn(shell, 'cp');
install(source[0], dummyPluginInfo, dummyProject);
expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'DummyPluginCommand.m'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.m'));
});
- it('should cp the file to the right target location when element has a target-dir', function() {
+ it('Test 006 : should cp the file to the right target location when element has a target-dir', function() {
var source = copyArray(valid_source).filter(function(s) { return s.targetDir !== undefined; });
var spy = spyOn(shell, 'cp');
install(source[0], dummyPluginInfo, dummyProject);
expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'TargetDirTest.m'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'));
});
- it('should call into xcodeproj\'s addFramework appropriately when element has framework=true set', function() {
+ it('Test 007 : should call into xcodeproj\'s addFramework appropriately when element has framework=true set', function() {
var source = copyArray(valid_source).filter(function(s) { return s.framework; });
spyOn(dummyProject.xcode, 'addFramework');
install(source[0], dummyPluginInfo, dummyProject);
@@ -142,13 +142,13 @@ describe('ios plugin handler', function() {
spyOn(dummyProject.xcode, 'addHeaderFile');
});
- it('should throw if header-file src cannot be found', function() {
+ it('Test 008 : should throw if header-file src cannot be found', function() {
var headers = copyArray(invalid_headers);
expect(function() {
install(headers[1], faultyPluginInfo, dummyProject);
}).toThrow();
});
- it('should throw if header-file target already exists', function() {
+ it('Test 009 : should throw if header-file target already exists', function() {
var headers = copyArray(valid_headers);
var target = path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.h');
shell.mkdir('-p', path.dirname(target));
@@ -157,25 +157,25 @@ describe('ios plugin handler', function() {
install(headers[0], dummyPluginInfo, dummyProject);
}).toThrow();
});
- it('should call into xcodeproj\'s addHeaderFile appropriately when element has no target-dir', function() {
+ it('Test 010 : should call into xcodeproj\'s addHeaderFile appropriately when element has no target-dir', function() {
var headers = copyArray(valid_headers).filter(function(s) { return s.targetDir === undefined; });
install(headers[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.addHeaderFile)
.toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.h'));
});
- it('should call into xcodeproj\'s addHeaderFile appropriately when element a target-dir', function() {
+ it('Test 011 : should call into xcodeproj\'s addHeaderFile appropriately when element a target-dir', function() {
var headers = copyArray(valid_headers).filter(function(s) { return s.targetDir !== undefined; });
install(headers[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.addHeaderFile)
.toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.h'));
});
- it('should cp the file to the right target location when element has no target-dir', function() {
+ it('Test 012 : should cp the file to the right target location when element has no target-dir', function() {
var headers = copyArray(valid_headers).filter(function(s) { return s.targetDir === undefined; });
var spy = spyOn(shell, 'cp');
install(headers[0], dummyPluginInfo, dummyProject);
expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'DummyPluginCommand.h'), path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'DummyPluginCommand.h'));
});
- it('should cp the file to the right target location when element has a target-dir', function() {
+ it('Test 013 : should cp the file to the right target location when element has a target-dir', function() {
var headers = copyArray(valid_headers).filter(function(s) { return s.targetDir !== undefined; });
var spy = spyOn(shell, 'cp');
install(headers[0], dummyPluginInfo, dummyProject);
@@ -190,34 +190,35 @@ describe('ios plugin handler', function() {
spyOn(dummyProject.xcode, 'addResourceFile');
});
- it('should throw if resource-file src cannot be found', function() {
+ it('Test 014 : should throw if resource-file src cannot be found', function() {
var resources = copyArray(invalid_resources);
expect(function() {
install(resources[0], faultyPluginInfo, dummyProject);
- }).toThrow('Cannot find resource file "' + path.resolve(faultyplugin, 'src/ios/IDontExist.bundle') + '" for plugin ' + faultyPluginInfo.id + ' in iOS platform');
+ }).toThrow(new Error ('Cannot find resource file "' + path.resolve(faultyplugin, 'src/ios/IDontExist.bundle') + '" for plugin ' + faultyPluginInfo.id + ' in iOS platform'));
});
- it('should throw if resource-file target already exists', function() {
+ it('Test 015 : should throw if resource-file target already exists', function() {
var resources = copyArray(valid_resources);
var target = path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle');
shell.mkdir('-p', path.dirname(target));
fs.writeFileSync(target, 'some bs', 'utf-8');
expect(function() {
install(resources[0], dummyPluginInfo, dummyProject);
- }).toThrow('File already exists at detination "' + target + '" for resource file specified by plugin ' + dummyPluginInfo.id + ' in iOS platform');
+ }).toThrow(new Error('File already exists at detination "' + target + '" for resource file specified by plugin ' + dummyPluginInfo.id + ' in iOS platform'));
});
- it('should call into xcodeproj\'s addResourceFile', function() {
+ it('Test 016 : should call into xcodeproj\'s addResourceFile', function() {
var resources = copyArray(valid_resources);
install(resources[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.addResourceFile)
.toHaveBeenCalledWith(path.join('Resources', 'DummyPlugin.bundle'));
});
- it('should cp the file to the right target location', function() {
+ it('Test 017 : should cp the file to the right target location', function() {
var resources = copyArray(valid_resources);
var spy = spyOn(shell, 'cp');
install(resources[0], dummyPluginInfo, dummyProject);
expect(spy).toHaveBeenCalledWith('-f', path.join(dummyplugin, 'src', 'ios', 'DummyPlugin.bundle'), path.join(temp, 'SampleApp', 'Resources', 'DummyPlugin.bundle'));
});
- it('should link files to the right target location', function() {
+
+ it('Test 018 : should link files to the right target location', function() {
var resources = copyArray(valid_resources);
var spy = spyOn(fs, 'linkSync');
install(resources[0], dummyPluginInfo, dummyProject, { link: true });
@@ -234,7 +235,7 @@ describe('ios plugin handler', function() {
spyOn(dummyProject.xcode, 'addFramework');
});
- it('should call into xcodeproj\'s addFramework', function() {
+ it('Test 019 : should call into xcodeproj\'s addFramework', function() {
var frameworks = copyArray(valid_custom_frameworks);
install(frameworks[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.addFramework)
@@ -246,28 +247,32 @@ describe('ios plugin handler', function() {
// * framework that shouldn't be added/removed
describe('with custom="true" attribute', function () {
- it('should throw if framework src cannot be found', function() {
+ it('Test 020 : should throw if framework src cannot be found', function() {
var frameworks = copyArray(invalid_custom_frameworks);
expect(function() {
install(frameworks[0], faultyPluginInfo, dummyProject);
- }).toThrow('Cannot find framework "' + path.resolve(faultyplugin, 'src/ios/NonExistantCustomFramework.framework') + '" for plugin ' + faultyPluginInfo.id + ' in iOS platform');
+ }).toThrow(new Error ('Cannot find framework "' + path.resolve(faultyplugin, 'src/ios/NonExistantCustomFramework.framework') + '" for plugin ' + faultyPluginInfo.id + ' in iOS platform'));
});
- it('should throw if framework target already exists', function() {
+ it('Test 021 : should throw if framework target already exists', function() {
var frameworks = copyArray(valid_custom_frameworks);
var target = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework');
shell.mkdir('-p', target);
expect(function() {
install(frameworks[0], dummyPluginInfo, dummyProject);
- }).toThrow('Framework "' + target + '" for plugin ' + dummyPluginInfo.id + ' already exists in iOS platform');
+ }).toThrow(new Error ('Framework "' + target + '" for plugin ' + dummyPluginInfo.id + ' already exists in iOS platform'));
});
- it('should cp the file to the right target location', function() {
+ it('Test 022 : should cp the file to the right target location', function() {
var frameworks = copyArray(valid_custom_frameworks);
var spy = spyOn(shell, 'cp');
install(frameworks[0], dummyPluginInfo, dummyProject);
expect(spy).toHaveBeenCalledWith('-Rf', path.join(dummyplugin, 'src', 'ios', 'Custom.framework', '*'),
path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework'));
});
+<<<<<<< HEAD
it('should deep link files to the right target location', function() {
+=======
+ it('Test 023 : should deep symlink files to the right target location', function() {
+>>>>>>> CB-12018 :updated tests to function with jasmine instead of jasmine-node
var frameworks = copyArray(valid_custom_frameworks);
var spy = spyOn(fs, 'linkSync');
install(frameworks[0], dummyPluginInfo, dummyProject, { link: true });
@@ -289,13 +294,13 @@ describe('ios plugin handler', function() {
platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src);
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test 024 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
install(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test 025 : should put module to www only when options.usePlatformWww flag is not specified', function () {
install(jsModule, dummyPluginInfo, dummyProject);
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).not.toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
@@ -313,20 +318,20 @@ describe('ios plugin handler', function() {
platformWwwDest = path.resolve(dummyProject.platformWww, asset.target);
});
- it('should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test 026 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
install(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.cp).toHaveBeenCalledWith('-f', path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.www, asset.target));
expect(shell.cp).toHaveBeenCalledWith('-f', path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.platformWww, asset.target));
});
- it('should put asset to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test 027 : should put asset to www only when options.usePlatformWww flag is not specified', function () {
install(asset, dummyPluginInfo, dummyProject);
expect(shell.cp).toHaveBeenCalledWith('-f', path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.www, asset.target));
expect(shell.cp).not.toHaveBeenCalledWith(path.resolve(dummyPluginInfo.dir, asset.src), path.resolve(dummyProject.platformWww, asset.target));
});
});
- it('of two plugins should apply xcode file changes from both', function(done){
+ it('Test 028 : of two plugins should apply xcode file changes from both', function(done){
var api = new Api('ios', temp);
var fail = jasmine.createSpy('fail');
@@ -370,29 +375,29 @@ describe('ios plugin handler', function() {
spyOn(dummyProject.xcode, 'removeFramework');
});
- it('should call into xcodeproj\'s removeSourceFile appropriately when element has no target-dir', function(){
+ it('Test 029 : should call into xcodeproj\'s removeSourceFile appropriately when element has no target-dir', function(){
var source = copyArray(valid_source).filter(function(s) { return s.targetDir === undefined; });
uninstall(source[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.removeSourceFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.m'));
});
- it('should call into xcodeproj\'s removeSourceFile appropriately when element a target-dir', function(){
+ it('Test 030 : should call into xcodeproj\'s removeSourceFile appropriately when element a target-dir', function(){
var source = copyArray(valid_source).filter(function(s) { return s.targetDir !== undefined; });
uninstall(source[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.removeSourceFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.m'));
});
- it('should rm the file from the right target location when element has no target-dir', function(){
+ it('Test 031 : should rm the file from the right target location when element has no target-dir', function(){
var source = copyArray(valid_source).filter(function(s) { return s.targetDir === undefined; });
var spy = spyOn(shell, 'rm');
uninstall(source[0], dummyPluginInfo, dummyProject);
expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', dummy_id));
});
- it('should rm the file from the right target location when element has a target-dir', function(){
+ it('Test 032 : should rm the file from the right target location when element has a target-dir', function(){
var source = copyArray(valid_source).filter(function(s) { return s.targetDir !== undefined; });
var spy = spyOn(shell, 'rm');
uninstall(source[0], dummyPluginInfo, dummyProject);
expect(spy).toHaveBeenCalledWith('-rf', path.join(temp, 'SampleApp', 'Plugins', dummy_id, 'targetDir'));
});
- it('should call into xcodeproj\'s removeFramework appropriately when element framework=true set', function(){
+ it('Test 033 : should call into xcodeproj\'s removeFramework appropriately when element framework=true set', function(){
var source = copyArray(valid_source).filter(function(s) { return s.framework; });
uninstall(source[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.removeFramework).toHaveBeenCalledWith(path.join('SampleApp', 'Plugins', dummy_id, 'SourceWithFramework.m'));
@@ -405,17 +410,17 @@ describe('ios plugin handler', function() {
spyOn(dummyProject.xcode, 'removeHeaderFile');
});
- it('should call into xcodeproj\'s removeHeaderFile appropriately when element has no target-dir', function(){
+ it('Test 034 : should call into xcodeproj\'s removeHeaderFile appropriately when element has no target-dir', function(){
var headers = copyArray(valid_headers).filter(function(s) { return s.targetDir === undefined; });
uninstall(headers[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.removeHeaderFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'DummyPluginCommand.h'));
});
- it('should call into xcodeproj\'s removeHeaderFile appropriately when element a target-dir', function(){
+ it('Test 035 : should call into xcodeproj\'s removeHeaderFile appropriately when element a target-dir', function(){
var headers = copyArray(valid_headers).filter(function(s) { return s.targetDir !== undefined; });
uninstall(headers[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.removeHeaderFile).toHaveBeenCalledWith(slashJoin('Plugins', dummy_id, 'targetDir', 'TargetDirTest.h'));
});
- it('should rm the file from the right target location', function(){
+ it('Test 036 : should rm the file from the right target location', function(){
var headers = copyArray(valid_headers).filter(function(s) { return s.targetDir !== undefined; });
var spy = spyOn(shell, 'rm');
uninstall(headers[0], dummyPluginInfo, dummyProject);
@@ -429,12 +434,12 @@ describe('ios plugin handler', function() {
spyOn(dummyProject.xcode, 'removeResourceFile');
});
- it('should call into xcodeproj\'s removeResourceFile', function(){
+ it('Test 037 : should call into xcodeproj\'s removeResourceFile', function(){
var resources = copyArray(valid_resources);
uninstall(resources[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.removeResourceFile).toHaveBeenCalledWith(path.join('Resources', 'DummyPlugin.bundle'));
});
- it('should rm the file from the right target location', function(){
+ it('Test 038 : should rm the file from the right target location', function(){
var resources = copyArray(valid_resources);
var spy = spyOn(shell, 'rm');
uninstall(resources[0], dummyPluginInfo, dummyProject);
@@ -450,7 +455,7 @@ describe('ios plugin handler', function() {
var frameworkPath = path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework').replace(/\\/g, '/');
- it('should call into xcodeproj\'s removeFramework', function(){
+ it('Test 039 : should call into xcodeproj\'s removeFramework', function(){
var frameworks = copyArray(valid_custom_frameworks);
uninstall(frameworks[0], dummyPluginInfo, dummyProject);
expect(dummyProject.xcode.removeFramework).toHaveBeenCalledWith(frameworkPath, {customFramework:true});
@@ -461,7 +466,7 @@ describe('ios plugin handler', function() {
// * framework that shouldn't be added/removed
describe('with custom="true" attribute', function () {
- it('should rm the file from the right target location', function(){
+ it('Test 040 : should rm the file from the right target location', function(){
var frameworks = copyArray(valid_custom_frameworks);
var spy = spyOn(shell, 'rm');
uninstall(frameworks[0], dummyPluginInfo, dummyProject);
@@ -470,7 +475,11 @@ describe('ios plugin handler', function() {
});
describe('without custom="true" attribute ', function() {
+<<<<<<< HEAD
it('should decrease framework counter after uninstallation', function() {
+=======
+ it('Test 041 : should decrease framework counter after uninstallation', function() {
+>>>>>>> CB-12018 :updated tests to function with jasmine instead of jasmine-node
var install = pluginHandlers.getInstaller('framework');
var dummyNonCustomFrameworks = dummyPluginInfo.getFrameworks('ios').filter(function(f) {
return !f.custom;
@@ -500,19 +509,19 @@ describe('ios plugin handler', function() {
spyOn(shell, 'rm');
var existsSyncOrig = fs.existsSync;
- spyOn(fs, 'existsSync').andCallFake(function (file) {
+ spyOn(fs, 'existsSync').and.callFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test 042 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
uninstall(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test 043 : should put module to www only when options.usePlatformWww flag is not specified', function () {
uninstall(jsModule, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
@@ -531,19 +540,19 @@ describe('ios plugin handler', function() {
spyOn(shell, 'rm');
var existsSyncOrig = fs.existsSync;
- spyOn(fs, 'existsSync').andCallFake(function (file) {
+ spyOn(fs, 'existsSync').and.callFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test 044 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
uninstall(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test 045 : should put module to www only when options.usePlatformWww flag is not specified', function () {
uninstall(asset, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/Podfile.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/Podfile.spec.js b/tests/spec/unit/Podfile.spec.js
index 545e63e..8fb6ffd 100644
--- a/tests/spec/unit/Podfile.spec.js
+++ b/tests/spec/unit/Podfile.spec.js
@@ -35,7 +35,7 @@ describe('unit tests for Podfile module', function () {
describe('tests', function () {
- it ('throws CordovaError when the path filename is not named Podfile', function () {
+ it ('Test 001 : throws CordovaError when the path filename is not named Podfile', function () {
var dummyPath = 'NotAPodfile';
expect( function () {
new Podfile(dummyPath);
@@ -43,34 +43,34 @@ describe('unit tests for Podfile module', function () {
.toThrow(new CordovaError(util.format('Podfile: The file at %s is not `%s`.', dummyPath, Podfile.FILENAME)));
});
- it ('throws CordovaError when no projectName provided when creating a Podfile', function () {
+ it ('Test 002 : throws CordovaError when no projectName provided when creating a Podfile', function () {
expect( function () {
new Podfile(fixturePodfile);
})
.toThrow(new CordovaError('Podfile: The projectName was not specified in the constructor.'));
});
- it ('throws CordovaError when no pod name provided when adding a spec', function () {
+ it ('Test 003 : throws CordovaError when no pod name provided when adding a spec', function () {
expect( function () {
podfile.addSpec(null);
})
.toThrow(new CordovaError('Podfile addSpec: name is not specified.'));
});
- it ('adds the spec', function () {
+ it ('Test 004 : adds the spec', function () {
expect(podfile.existsSpec('Foo')).toBe(false);
podfile.addSpec('Foo', '1.0');
expect(podfile.existsSpec('Foo')).toBe(true);
});
- it ('removes the spec', function () {
+ it ('Test 005 : removes the spec', function () {
podfile.addSpec('Baz', '3.0');
expect(podfile.existsSpec('Baz')).toBe(true);
podfile.removeSpec('Baz');
expect(podfile.existsSpec('Baz')).toBe(false);
});
- it ('clears all specs', function () {
+ it ('Test 006 : clears all specs', function () {
podfile.addSpec('Bar', '2.0');
podfile.clear();
@@ -78,7 +78,7 @@ describe('unit tests for Podfile module', function () {
expect(podfile.existsSpec('Bar')).toBe(false);
});
- it ('isDirty tests', function () {
+ it ('Test 007 : isDirty tests', function () {
podfile.addSpec('Foo', '1.0');
expect(podfile.isDirty()).toBe(true);
@@ -95,7 +95,7 @@ describe('unit tests for Podfile module', function () {
expect(podfile.isDirty()).toBe(false);
});
- it ('writes specs to the Podfile', function () {
+ it ('Test 008 : writes specs to the Podfile', function () {
podfile.clear();
podfile.addSpec('Foo', '1.0');
@@ -118,7 +118,7 @@ describe('unit tests for Podfile module', function () {
expect(newPodfile.getSpec('Bla')).toBe(podfile.getSpec('Bla'));
});
- it ('runs before_install to install xcconfig paths', function () {
+ it ('Test 009 : runs before_install to install xcconfig paths', function () {
podfile.before_install();
// Template tokens in order: project name, project name, debug | release
@@ -139,7 +139,7 @@ describe('unit tests for Podfile module', function () {
});
- it('tear down', function () {
+ it('Test 010 : tear down', function () {
podfile.destroy();
var text = '// DO NOT MODIFY -- auto-generated by Apache Cordova\n';
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/PodsJson.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/PodsJson.spec.js b/tests/spec/unit/PodsJson.spec.js
index 6f845e9..aa9b9ca 100644
--- a/tests/spec/unit/PodsJson.spec.js
+++ b/tests/spec/unit/PodsJson.spec.js
@@ -30,7 +30,7 @@ describe('unit tests for Podfile module', function () {
describe('tests', function () {
- it ('throws CordovaError when the path filename is not named pods.json', function () {
+ it ('Test 001 : throws CordovaError when the path filename is not named pods.json', function () {
var dummyPath = 'NotPodsJson';
expect( function () {
new PodsJson(dummyPath);
@@ -38,7 +38,7 @@ describe('unit tests for Podfile module', function () {
.toThrow(new CordovaError(util.format('PodsJson: The file at %s is not `%s`.', dummyPath, PodsJson.FILENAME)));
});
- it ('sets and gets pod test', function () {
+ it ('Test 002 : sets and gets pod test', function () {
var val0 = {
name: 'Foo',
type: 'podspec',
@@ -55,7 +55,7 @@ describe('unit tests for Podfile module', function () {
expect(val1.count).toEqual(val0.count);
});
- it ('setsJson and remove pod test', function () {
+ it ('Test 003 : setsJson and remove pod test', function () {
var val0 = {
name: 'Bar',
type: 'podspec',
@@ -76,7 +76,7 @@ describe('unit tests for Podfile module', function () {
expect(val1).toBeFalsy();
});
- it ('clears all pods', function () {
+ it ('Test 004 : clears all pods', function () {
var val0 = {
name: 'Baz',
type: 'podspec',
@@ -91,7 +91,7 @@ describe('unit tests for Podfile module', function () {
expect(podsjson.get('Bar')).toBeFalsy();
});
- it ('isDirty tests', function () {
+ it ('Test 005 : isDirty tests', function () {
var val0 = {
name: 'Foo',
type: 'podspec',
@@ -115,7 +115,7 @@ describe('unit tests for Podfile module', function () {
expect(podsjson.isDirty()).toBe(false);
});
- it ('increment and decrement count test', function () {
+ it ('Test 006 : increment and decrement count test', function () {
var val0 = {
name: 'Bla',
type: 'podspec',
@@ -143,7 +143,7 @@ describe('unit tests for Podfile module', function () {
expect(podsjson.get(val0.name)).toBeFalsy();
});
- it ('writes pods to the pods.json', function () {
+ it ('Test 007 : writes pods to the pods.json', function () {
podsjson.clear();
var vals = {
@@ -180,7 +180,7 @@ describe('unit tests for Podfile module', function () {
});
- it('tear down', function () {
+ it('Test 008 : tear down', function () {
podsjson.destroy();
});
});
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/prepare.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index bf0d303..478695c 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -559,11 +559,13 @@ describe('prepare', function() {
beforeEach(function() {
mv = spyOn(shell, 'mv');
writeFileSyncSpy = spyOn(fs, 'writeFileSync');
- spyOn(plist, 'parse').andReturn({});
- spyOn(plist, 'build').andReturn('');
- spyOn(xcode, 'project').andCallFake(function (pbxproj) {
+
+ spyOn(plist, 'parse').and.returnValue({});
+ spyOn(plist, 'build').and.returnValue('');
+ spyOn(xcode, 'project').and.callFake(function (pbxproj) {
+
var xc = new xcOrig(pbxproj);
- update_name = spyOn(xc, 'updateProductName').andCallThrough();
+ update_name = spyOn(xc, 'updateProductName').and.callThrough();
return xc;
});
cfg.name = function() { return 'SampleApp'; }; // this is to match p's original project name (based on .xcodeproj)
@@ -573,7 +575,7 @@ describe('prepare', function() {
spyOn(cfg, 'getPreference');
});
- it('should not update the app name in pbxproj', function(done) {
+ it('Test#001 : should not update the app name in pbxproj', function(done) {
var cfg2OriginalName = cfg2.name;
// originalName here will be `SampleApp` (based on the xcodeproj basename) from p
@@ -587,6 +589,7 @@ describe('prepare', function() {
// restore cfg2 original name
cfg2.name = cfg2OriginalName;
});
+
it('should write target-device preference', function(done) {
var cfg2OriginalName = cfg2.name;
cfg2.name = function() { return 'SampleApp'; }; // new config does *not* have a name change
@@ -619,7 +622,8 @@ describe('prepare', function() {
cfg2.name = cfg2OriginalName;
});
});
- it('should write out the app id to info plist as CFBundleIdentifier', function(done) {
+
+ it('Test#002 : should write out the app id to info plist as CFBundleIdentifier', function(done) {
var orig = cfg.getAttribute;
cfg.getAttribute = function(name) {
if (name == 'ios-CFBundleIdentifier') {
@@ -632,7 +636,7 @@ describe('prepare', function() {
expect(plist.build.mostRecentCall.args[0].CFBundleIdentifier).toEqual('testpkg');
});
});
- it('should write out the app id to info plist as CFBundleIdentifier with ios-CFBundleIdentifier', function(done) {
+ it('Test#003 : should write out the app id to info plist as CFBundleIdentifier with ios-CFBundleIdentifier', function(done) {
var orig = cfg.getAttribute;
cfg.getAttribute = function(name) {
if (name == 'ios-CFBundleIdentifier') {
@@ -645,70 +649,70 @@ describe('prepare', function() {
expect(plist.build.mostRecentCall.args[0].CFBundleIdentifier).toEqual('testpkg_ios');
});
});
- it('should write out the app version to info plist as CFBundleVersion', function(done) {
+ it('Test#004 : should write out the app version to info plist as CFBundleVersion', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].CFBundleShortVersionString).toEqual('one point oh');
});
});
- it('should write out the orientation preference value', function(done) {
- cfg.getPreference.andCallThrough();
+ it('Test#005 : should write out the orientation preference value', function(done) {
+ cfg.getPreference.and.callThrough();
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]);
expect(plist.build.mostRecentCall.args[0]['UISupportedInterfaceOrientations~ipad']).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]);
expect(plist.build.mostRecentCall.args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationPortrait' ]);
});
});
- it('should handle no orientation', function(done) {
- cfg.getPreference.andReturn('');
+ it('Test#006 : should handle no orientation', function(done) {
+ cfg.getPreference.and.returnValue('');
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].UISupportedInterfaceOrientations).toBeUndefined();
expect(plist.build.mostRecentCall.args[0]['UISupportedInterfaceOrientations~ipad']).toBeUndefined();
expect(plist.build.mostRecentCall.args[0].UIInterfaceOrientation).toBeUndefined();
});
});
- it('should handle default orientation', function(done) {
- cfg.getPreference.andReturn('default');
+ it('Test#007 : should handle default orientation', function(done) {
+ cfg.getPreference.and.returnValue('default');
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]);
expect(plist.build.mostRecentCall.args[0]['UISupportedInterfaceOrientations~ipad']).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]);
expect(plist.build.mostRecentCall.args[0].UIInterfaceOrientation).toBeUndefined();
});
});
- it('should handle portrait orientation', function(done) {
- cfg.getPreference.andReturn('portrait');
+ it('Test#008 : should handle portrait orientation', function(done) {
+ cfg.getPreference.and.returnValue('portrait');
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown' ]);
expect(plist.build.mostRecentCall.args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationPortrait' ]);
});
});
- it('should handle landscape orientation', function(done) {
- cfg.getPreference.andReturn('landscape');
+ it('Test#009 : should handle landscape orientation', function(done) {
+ cfg.getPreference.and.returnValue('landscape');
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]);
expect(plist.build.mostRecentCall.args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationLandscapeLeft' ]);
});
});
- it('should handle all orientation on ios', function(done) {
- cfg.getPreference.andReturn('all');
+ it('Test#010 : should handle all orientation on ios', function(done) {
+ cfg.getPreference.and.returnValue('all');
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]);
expect(plist.build.mostRecentCall.args[0].UIInterfaceOrientation).toEqual([ 'UIInterfaceOrientationPortrait' ]);
});
});
- it('should handle custom orientation', function(done) {
- cfg.getPreference.andReturn('some-custom-orientation');
+ it('Test#011 : should handle custom orientation', function(done) {
+ cfg.getPreference.and.returnValue('some-custom-orientation');
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].UISupportedInterfaceOrientations).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]);
expect(plist.build.mostRecentCall.args[0]['UISupportedInterfaceOrientations~ipad']).toEqual([ 'UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight' ]);
expect(plist.build.mostRecentCall.args[0].UIInterfaceOrientation).toBeUndefined();
});
});
+
///// App Transport Security Tests /////////////////////////////
// NOTE: if an ATS value is equal to "null", it means that it was not written,
// thus it will use the default (check the default for the key).
// This is to prevent the Info.plist to be too verbose.
-
- it('<access> - should handle wildcard', function(done) {
+ it('Test#012 : <access> - should handle wildcard', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
var ats = plist.build.mostRecentCall.args[0].NSAppTransportSecurity;
expect(ats.NSAllowsArbitraryLoads).toEqual(true);
@@ -812,8 +816,7 @@ describe('prepare', function() {
});
});
-
- it('<access> - https, subdomain wildcard', function(done) {
+ it('Test#13 : <access> - https, subdomain wildcard', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
var ats = plist.build.mostRecentCall.args[0].NSAppTransportSecurity;
var exceptionDomains = ats.NSExceptionDomains;
@@ -887,7 +890,7 @@ describe('prepare', function() {
});
});
- it('<access> - http, no wildcard', function(done) {
+ it('Test#014 : <access> - http, no wildcard', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
var ats = plist.build.mostRecentCall.args[0].NSAppTransportSecurity;
var exceptionDomains = ats.NSExceptionDomains;
@@ -961,7 +964,7 @@ describe('prepare', function() {
});
});
- it('<access> - https, no wildcard', function(done) {
+ it('Test#015 : <access> - https, no wildcard', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
var ats = plist.build.mostRecentCall.args[0].NSAppTransportSecurity;
var exceptionDomains = ats.NSExceptionDomains;
@@ -1035,7 +1038,7 @@ describe('prepare', function() {
});
});
//////////////////////////////////////////////////
- it('<access>, <allow-navigation> - http and https, no clobber', function(done) {
+ it('Test#016 : <access>, <allow-navigation> - http and https, no clobber', function(done) {
var cfg2OriginalName = cfg2.name;
// original name here is 'SampleApp' based on p
// we are not testing a name change here, but testing a new config being used (name change test is above)
@@ -1324,7 +1327,7 @@ describe('prepare', function() {
});
});
- it('<allow-navigation> - wildcard scheme, wildcard subdomain', function(done) {
+ it('Test#017 : <allow-navigation> - wildcard scheme, wildcard subdomain', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
var ats = plist.build.mostRecentCall.args[0].NSAppTransportSecurity;
var exceptionDomains = ats.NSExceptionDomains;
@@ -1398,7 +1401,7 @@ describe('prepare', function() {
});
});
- it('<allow-navigation> - wildcard scheme, no subdomain', function(done) {
+ it('Test#018 : <allow-navigation> - wildcard scheme, no subdomain', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
var ats = plist.build.mostRecentCall.args[0].NSAppTransportSecurity;
var exceptionDomains = ats.NSExceptionDomains;
@@ -1472,7 +1475,7 @@ describe('prepare', function() {
});
});
- it('<allow-navigation> - should ignore wildcards like data:*, https:*, https://*', function(done) {
+ it('Test#019 : <allow-navigation> - should ignore wildcards like data:*, https:*, https://*', function(done) {
wrapper(updateProject(cfg, p.locations), done, function() {
var ats = plist.build.mostRecentCall.args[0].NSAppTransportSecurity;
var exceptionDomains = ats.NSExceptionDomains;
@@ -1488,7 +1491,7 @@ describe('prepare', function() {
var logFileOp = prepare.__get__('logFileOp');
beforeEach(function () {
- spyOn(FileUpdater, 'mergeAndUpdateDir').andReturn(true);
+ spyOn(FileUpdater, 'mergeAndUpdateDir').and.returnValue(true);
});
var project = {
@@ -1496,7 +1499,7 @@ describe('prepare', function() {
locations: { www: path.join(iosProject, 'www') }
};
- it('should update project-level www and with platform agnostic www and merges', function() {
+ it('Test#020 : should update project-level www and with platform agnostic www and merges', function() {
var merges_path = path.join(project.root, 'merges', 'ios');
shell.mkdir('-p', merges_path);
updateWww(project, p.locations);
@@ -1506,7 +1509,7 @@ describe('prepare', function() {
{ rootDir : iosProject },
logFileOp);
});
- it('should skip merges if merges directory does not exist', function() {
+ it('Test#021 : should skip merges if merges directory does not exist', function() {
var merges_path = path.join(project.root, 'merges', 'ios');
shell.rm('-rf', merges_path);
updateWww(project, p.locations);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/preparePlatform.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/preparePlatform.spec.js b/tests/spec/unit/preparePlatform.spec.js
index 548f2f9..146ed77 100644
--- a/tests/spec/unit/preparePlatform.spec.js
+++ b/tests/spec/unit/preparePlatform.spec.js
@@ -59,14 +59,14 @@ describe('prepare after plugin add', function() {
shell.cp('-rf', iosProjectFixture + '/*', iosPlatform);
api = new Api('ios', iosPlatform, new EventEmitter());
- this.addMatchers(customMatchers);
+ jasmine.addMatchers(customMatchers);
});
afterEach(function() {
shell.rm('-rf', iosPlatform);
});
- it('should not overwrite plugin metadata added by "addPlugin"', function(done) {
+ it('Test 001 : should not overwrite plugin metadata added by "addPlugin"', function(done) {
var project = {
root: iosProject,
projectConfig: new ConfigParser(path.join(iosProject, 'config.xml')),
@@ -77,7 +77,7 @@ describe('prepare after plugin add', function() {
};
var fail = jasmine.createSpy('fail')
- .andCallFake(function (err) {
+ .and.callFake(function (err) {
console.error(err);
});
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/73a53115/tests/spec/unit/projectFile.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/projectFile.spec.js b/tests/spec/unit/projectFile.spec.js
index e4531df..3ba6546 100644
--- a/tests/spec/unit/projectFile.spec.js
+++ b/tests/spec/unit/projectFile.spec.js
@@ -40,21 +40,21 @@ describe('projectFile', function() {
});
describe('parse method', function () {
- it('should throw if project is not an xcode project', function() {
+ it('Test#001 : should throw if project is not an xcode project', function() {
shell.rm('-rf', path.join(iosProject, 'SampleApp', 'SampleApp.xcodeproj'));
expect(function() { projectFile.parse(); }).toThrow();
});
- it('should throw if project does not contain an appropriate config.xml file', function() {
+ it('Test#002 : should throw if project does not contain an appropriate config.xml file', function() {
shell.rm(path.join(iosProject, 'SampleApp', 'config.xml'));
expect(function() { projectFile.parse(locations); })
- .toThrow('Could not find *-Info.plist file, or config.xml file.');
+ .toThrow(new Error('Could not find *-Info.plist file, or config.xml file.'));
});
- it('should throw if project does not contain an appropriate -Info.plist file', function() {
+ it('Test#003 : should throw if project does not contain an appropriate -Info.plist file', function() {
shell.rm(path.join(iosProject, 'SampleApp', 'SampleApp-Info.plist'));
expect(function () { projectFile.parse(locations); })
- .toThrow('Could not find *-Info.plist file, or config.xml file.');
+ .toThrow(new Error('Could not find *-Info.plist file, or config.xml file.'));
});
- it('should return right directory when multiple .plist files are present', function() {
+ it('Test#004 : should return right directory when multiple .plist files are present', function() {
//Create a folder named A with config.xml and .plist files in it
var pathToFolderA = path.join(iosProject, 'A');
shell.mkdir(pathToFolderA);
@@ -76,7 +76,7 @@ describe('projectFile', function() {
});
describe('other methods', function () {
- it('getPackageName method should return the CFBundleIdentifier from the project\'s Info.plist file', function() {
+ it('Test#005 : getPackageName method should return the CFBundleIdentifier from the project\'s Info.plist file', function() {
expect(projectFile.parse(locations).getPackageName()).toEqual('com.example.friendstring');
});
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] ios commit: CB-12018 : updated pkg.json with jasmine changes to
work with jasmine instead of jasmine-node and rebased off of master branch.
Posted by st...@apache.org.
CB-12018 : updated pkg.json with jasmine changes to work with jasmine instead of jasmine-node and rebased off of master branch.
This closes #284
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/32a9eca3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/32a9eca3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/32a9eca3
Branch: refs/heads/master
Commit: 32a9eca362036077223ae521da3da091ea56eb6f
Parents: 73a5311
Author: audreyso <au...@adobe.com>
Authored: Tue Jan 10 15:01:39 2017 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Tue Jan 17 09:20:05 2017 -0800
----------------------------------------------------------------------
.gitignore | 10 +++++-
appveyor.yml | 2 +-
package.json | 8 ++---
spec/support/jasmine.json | 8 +++++
tests/spec/unit/Plugman/pluginHandler.spec.js | 10 ++----
tests/spec/unit/prepare.spec.js | 18 +++++-----
tests/spec/unit/preparePlatform.spec.js | 39 +++++++++++++---------
7 files changed, 57 insertions(+), 38 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32a9eca3/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index ac9b101..4e6a1e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -215,4 +215,12 @@ node_modules/yallist/
node_modules/yargs/
coverage/
npm-debug.log
-
+node_modules/.bin/color-support
+node_modules/.bin/jasmine
+node_modules/asynckit/
+node_modules/aws4/
+node_modules/bcrypt-pbkdf/
+node_modules/color-support/
+node_modules/fs.realpath/
+node_modules/jasmine-core/
+node_modules/jasmine/
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32a9eca3/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index 6e92b88..1cc5ba8 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -9,7 +9,7 @@ install:
- ps: Install-Product node $env:nodejs_version
# Lines below required due to uncrustify installation failure on Windows
- npm install --prod
- - npm install jshint jasmine-node rewire
+ - npm install jshint jasmine rewire
build: off
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32a9eca3/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index fb117bf..745d99a 100644
--- a/package.json
+++ b/package.json
@@ -17,11 +17,11 @@
"scripts": {
"test": "npm run e2e-tests && npm run objc-tests && npm run unit-tests",
"posttest": "npm run jshint",
- "cover": "istanbul cover node_modules/jasmine-node/bin/jasmine-node -- tests/spec/unit",
- "e2e-tests": "jasmine-node --captureExceptions --color tests/spec",
+ "cover": "istanbul cover --root bin/templates/cordova --print detail jasmine",
+ "e2e-tests": "jasmine --captureExceptions --color tests/spec/create.spec.js",
"objc-tests": "xcodebuild test -workspace tests/cordova-ios.xcworkspace -scheme CordovaLibTests -destination \"platform=iOS Simulator,name=iPhone 5\" CONFIGURATION_BUILD_DIR=\"`mktemp -d 2>/dev/null || mktemp -d -t 'cordova-ios'`\"",
"preobjc-tests": "tests/scripts/killsim.js",
- "unit-tests": "jasmine-node --captureExceptions --color tests/spec/unit",
+ "unit-tests": "jasmine --captureExceptions --color",
"jshint": "jshint bin tests"
},
"author": "Apache Software Foundation",
@@ -29,7 +29,7 @@
"devDependencies": {
"coffee-script": "^1.7.1",
"istanbul": "^0.4.2",
- "jasmine": "^2.5.2",
+ "jasmine": "^2.5.3",
"jshint": "^2.6.0",
"nodeunit": "^0.8.7",
"rewire": "^2.5.1",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32a9eca3/spec/support/jasmine.json
----------------------------------------------------------------------
diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json
new file mode 100644
index 0000000..6824f85
--- /dev/null
+++ b/spec/support/jasmine.json
@@ -0,0 +1,8 @@
+{
+ "spec_dir": "spec",
+ "spec_files": [
+ "../tests/spec/unit/**/*[sS]pec.js"
+ ],
+ "stopSpecOnExpectationFailure": false,
+ "random": false
+}
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32a9eca3/tests/spec/unit/Plugman/pluginHandler.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/Plugman/pluginHandler.spec.js b/tests/spec/unit/Plugman/pluginHandler.spec.js
index 5b2df77..4cf733c 100644
--- a/tests/spec/unit/Plugman/pluginHandler.spec.js
+++ b/tests/spec/unit/Plugman/pluginHandler.spec.js
@@ -268,11 +268,8 @@ describe('ios plugin handler', function() {
expect(spy).toHaveBeenCalledWith('-Rf', path.join(dummyplugin, 'src', 'ios', 'Custom.framework', '*'),
path.join(temp, 'SampleApp/Plugins/org.test.plugins.dummyplugin/Custom.framework'));
});
-<<<<<<< HEAD
- it('should deep link files to the right target location', function() {
-=======
+
it('Test 023 : should deep symlink files to the right target location', function() {
->>>>>>> CB-12018 :updated tests to function with jasmine instead of jasmine-node
var frameworks = copyArray(valid_custom_frameworks);
var spy = spyOn(fs, 'linkSync');
install(frameworks[0], dummyPluginInfo, dummyProject, { link: true });
@@ -475,11 +472,8 @@ describe('ios plugin handler', function() {
});
describe('without custom="true" attribute ', function() {
-<<<<<<< HEAD
- it('should decrease framework counter after uninstallation', function() {
-=======
+
it('Test 041 : should decrease framework counter after uninstallation', function() {
->>>>>>> CB-12018 :updated tests to function with jasmine instead of jasmine-node
var install = pluginHandlers.getInstaller('framework');
var dummyNonCustomFrameworks = dummyPluginInfo.getFrameworks('ios').filter(function(f) {
return !f.custom;
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32a9eca3/tests/spec/unit/prepare.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index 478695c..69d1d92 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -593,7 +593,7 @@ describe('prepare', function() {
it('should write target-device preference', function(done) {
var cfg2OriginalName = cfg2.name;
cfg2.name = function() { return 'SampleApp'; }; // new config does *not* have a name change
- writeFileSyncSpy.andCallThrough();
+ writeFileSyncSpy.and.callThrough();
wrapper(updateProject(cfg2, p.locations), done, function() {
var xcode = require('xcode');
@@ -609,7 +609,7 @@ describe('prepare', function() {
it('should write deployment-target preference', function(done) {
var cfg2OriginalName = cfg2.name;
cfg2.name = function() { return 'SampleApp'; }; // new config does *not* have a name change
- writeFileSyncSpy.andCallThrough();
+ writeFileSyncSpy.and.callThrough();
wrapper(updateProject(cfg2, p.locations), done, function() {
var xcode = require('xcode');
@@ -728,7 +728,7 @@ describe('prepare', function() {
var configXml = '<?xml version="1.0" encoding="UTF-8"?><widget id="io.cordova.hellocordova" ios-CFBundleIdentifier="io.cordova.hellocordova.ios" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"><name>SampleApp</name>' +
'<access origin="*" allows-arbitrary-loads-in-web-content="true" />' +
'</widget>';
- readFile.andReturn(configXml);
+ readFile.and.returnValue(configXml);
var my_config = new ConfigParser('fake/path');
@@ -747,7 +747,7 @@ describe('prepare', function() {
var configXml = '<?xml version="1.0" encoding="UTF-8"?><widget id="io.cordova.hellocordova" ios-CFBundleIdentifier="io.cordova.hellocordova.ios" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"><name>SampleApp</name>' +
'<access origin="*" allows-arbitrary-loads-in-media="true" />' +
'</widget>';
- readFile.andReturn(configXml);
+ readFile.and.returnValue(configXml);
var my_config = new ConfigParser('fake/path');
@@ -766,7 +766,7 @@ describe('prepare', function() {
var configXml = '<?xml version="1.0" encoding="UTF-8"?><widget id="io.cordova.hellocordova" ios-CFBundleIdentifier="io.cordova.hellocordova.ios" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"><name>SampleApp</name>' +
'<access origin="*" allows-local-networking="true" />' +
'</widget>';
- readFile.andReturn(configXml);
+ readFile.and.returnValue(configXml);
var my_config = new ConfigParser('fake/path');
@@ -785,7 +785,7 @@ describe('prepare', function() {
var configXml = '<?xml version="1.0" encoding="UTF-8"?><widget id="io.cordova.hellocordova" ios-CFBundleIdentifier="io.cordova.hellocordova.ios" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"><name>SampleApp</name>' +
'<access origin="*" allows-arbitrary-loads-in-web-content="true" allows-arbitrary-loads-in-media="true" allows-local-networking="true" />' +
'</widget>';
- readFile.andReturn(configXml);
+ readFile.and.returnValue(configXml);
var my_config = new ConfigParser('fake/path');
@@ -803,7 +803,7 @@ describe('prepare', function() {
var configXml = '<?xml version="1.0" encoding="UTF-8"?><widget id="io.cordova.hellocordova" ios-CFBundleIdentifier="io.cordova.hellocordova.ios" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"><name>SampleApp</name>' +
'<access origin="http://cordova.apache.org" allows-arbitrary-loads-in-web-content="true" allows-arbitrary-loads-in-media="true" allows-local-networking="true" />' +
'</widget>';
- readFile.andReturn(configXml);
+ readFile.and.returnValue(configXml);
var my_config = new ConfigParser('fake/path');
@@ -1072,7 +1072,7 @@ describe('prepare', function() {
var configXml = '<?xml version="1.0" encoding="UTF-8"?><widget id="io.cordova.hellocordova" ios-CFBundleIdentifier="io.cordova.hellocordova.ios" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"><name>SampleApp</name>' +
'<allow-navigation href="*" />' +
'</widget>';
- readFile.andReturn(configXml);
+ readFile.and.returnValue(configXml);
var my_config = new ConfigParser('fake/path');
@@ -1091,7 +1091,7 @@ describe('prepare', function() {
var configXml = '<?xml version="1.0" encoding="UTF-8"?><widget id="io.cordova.hellocordova" ios-CFBundleIdentifier="io.cordova.hellocordova.ios" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"><name>SampleApp</name>' +
'<allow-navigation href="http://cordova.apache.org" allows-arbitrary-loads-in-web-content="true" allows-arbitrary-loads-in-media="true" allows-local-networking="true" />' +
'</widget>';
- readFile.andReturn(configXml);
+ readFile.and.returnValue(configXml);
var my_config = new ConfigParser('fake/path');
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32a9eca3/tests/spec/unit/preparePlatform.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/preparePlatform.spec.js b/tests/spec/unit/preparePlatform.spec.js
index 146ed77..3c4b150 100644
--- a/tests/spec/unit/preparePlatform.spec.js
+++ b/tests/spec/unit/preparePlatform.spec.js
@@ -38,20 +38,6 @@ var dummyPlugin = path.join(FIXTURES, DUMMY_PLUGIN);
shell.config.silent = true;
-var customMatchers = {
- toBeInstalledIn: function(platformDir) {
- var content;
- try {
- content = fs.readFileSync(path.join(platformDir, 'ios.json'));
- } catch (e) {
- return false;
- }
-
- var cfg = JSON.parse(content);
- return Object.keys(cfg.installed_plugins).indexOf(this.actual) > -1;
- }
-};
-
describe('prepare after plugin add', function() {
var api;
beforeEach(function() {
@@ -59,7 +45,30 @@ describe('prepare after plugin add', function() {
shell.cp('-rf', iosProjectFixture + '/*', iosPlatform);
api = new Api('ios', iosPlatform, new EventEmitter());
- jasmine.addMatchers(customMatchers);
+ jasmine.addMatchers({
+ 'toBeInstalledIn': function () {
+ return {
+ compare: function(actual, expected) {
+ var result = {};
+ var content;
+ try {
+ content = fs.readFileSync(path.join(expected, 'ios.json'));
+ var cfg = JSON.parse(content);
+ result.pass = Object.keys(cfg.installed_plugins).indexOf(actual) > -1;
+ } catch (e) {
+ result.pass = false;
+ }
+
+ if(result.pass) {
+ result.message = 'Expected '+ actual + ' to be installed in '+ expected+'.';
+ } else {
+ result.message = 'Expected '+ actual + ' to not be installed in '+ expected+'.';
+ }
+ return result;
+ }
+ };
+ }
+ });
});
afterEach(function() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org