[
https://issues.apache.org/jira/browse/CB-9122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14582552#comment-14582552
]
ASF GitHub Bot commented on CB-9122:
------------------------------------
Github user omefire commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/246#discussion_r32271456
--- Diff: cordova-lib/spec-cordova/save.spec.js ---
@@ -0,0 +1,435 @@
+/**
+ 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.
+*/
+
+describe('(save flag)', function () {
+ var rewire = require('rewire'),
+ cordova = require('../src/cordova/cordova'),
+ helpers = require('./helpers'),
+ path = require('path'),
+ Q = require('q'),
+ fs = require('fs'),
+ shell = require('shelljs'),
+ util = require('../src/cordova/util'),
+ platform = rewire('../src/cordova/platform.js');
+
+ var appName = 'testApp',
+ tempPath = path.join(__dirname, 'temp'),
+ appPath = path.join(tempPath, appName),
+ platformName = helpers.testPlatform,
+ platformVersionOld = '4.0.0',
+ platformVersionNew = '4.0.1',
+ platformLocalPath = path.join(tempPath, 'cordova-' +
platformName),
+ platformGitUrl = 'https://github.com/apache/cordova-' +
platformName,
+ platformGitRef = '4.0.x',
+ platformTgzUrl =
'https://git-wip-us.apache.org/repos/asf?p=cordova-' + platformName +
'.git;a=snapshot;h=' + platformVersionNew + ';sf=tgz',
+ pluginName = 'cordova-plugin-console',
+ pluginVersion = '1.0.0',
+ pluginGitUrl =
'https://github.com/apache/cordova-plugin-console.git',
+ pluginOldName = 'org.apache.cordova.console',
+ pluginOldVersion = '0.2.11',
+ variablePluginName = 'com.phonegap.plugins.facebookconnect',
+ variablePluginUrl =
'https://github.com/Wizcorp/phonegap-facebook-plugin',
+ localPluginName = 'org.apache.cordova.fakeplugin1',
+ localPluginPath = path.join(__dirname, 'fixtures', 'plugins',
'fake1'),
+ timeout = 60 * 1000;
+
+ //mocks
+ var is_cordova, cd_project_root, prepare,
+ revert_copy_cordova_js, revert_copy_cordovajs_src,
revert_install_plugins_for_new_platform;
+
+ beforeEach(function (done) {
+ is_cordova = spyOn(util, 'isCordova').andReturn(appPath);
+ cd_project_root = spyOn(util, 'cdProjectRoot').andReturn(appPath);
+ prepare = spyOn(cordova.raw, 'prepare').andReturn(Q());
+
+ fs.exists(appPath, function (exists) {
+ if (exists) {
+ cordova.raw.platform('rm', platformName).then(done, done);
+ } else {
+ done();
+ }
+ });
+ });
+
+ describe('(preparing fixtures)', function () {
+ it('preparing temp dir', function () {
--- End diff --
Move this to 'beforeEach'.
> Implement integration tests for platform and plugin save/restore feature
> ------------------------------------------------------------------------
>
> Key: CB-9122
> URL: https://issues.apache.org/jira/browse/CB-9122
> Project: Apache Cordova
> Issue Type: Task
> Components: CordovaLib
> Reporter: Alexander Sorokin
>
> List of integration tests and scenarios to be written :
>
> CORDOVA PLATFORM/PLUGIN ADD TESTS :
> - Ensure that support for custom .tgz files is still enabled (VS
> depends on this)
> - cordova platform add android --save [empty config.xml]
> - cordova platform add android --save [config.xml already contains
> [email protected]]
> - cordova platform add android --save [config.xml contains
> android@file://C:/path/to/android]
> - cordova platform add [email protected] --save [invalid version => in
> this case, install should fail and should not update config.xml]
> - cordova platform add C://path/to/android/platform --save
> - support for custom branch checkout : cordova platform add
> https://github.com/apache/cordova-android.git#2.6.x
> - cordova plugin add cordova-plugin-console –save [config.xml empty]
> - cordova plugin add cordova-plugin-console –save [config.xml
> already contains [email protected]]
> - cordova plugin add facebook-plugins –variables … –save [testing
> variables support]
> - cordova plugin add git_url
> - cordova plugin add local_folder
>
> CORDOVA PLATFORM/PLUGIN REMOVE TESTS :
> - cordova platform remove android --save [config.xml is empty]
> - cordova platform remove android --save [config.xml contains
> android@C:/path/to/android/platform]
> - cordova plugin remove plugin-id --save [config.xml is empty]
> - cordova plugin remove plugin-id --save [config.xml contains
> git-url of plugin]
>
> CORDOVA PLATFORM/PLUGIN UPDATE TESTS :
> - cordova platform update [email protected] --save [config.xml already
> contains [email protected]]
> - support for git-urls : cordova platform update
> https://github.com/apache/cordova-android.git –save
> - cordova plugin update cordova-plugin-console --save
> - cordova plugin update [email protected] --save
>
> MASS-SAVE TESTS :
> - cordova platform save [no platforms installed => no update to
> config.xml]
> - cordova platform save [with some platforms installed]
> - cordova plugin save [no plugins installed => no update to
> config.xml]
> - cordova plugin save [with some plugins installed: one with
> version, one with local folder and another one via git cloning]
>
> PLATFORM/PLUGIN RESTORATION :
> - cordova prepare => should restore all platforms and plugins
> - cordova prepare android
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]