cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alsorokin <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: CB-9122 Added tests for platform/plugin ...
Date Tue, 16 Jun 2015 12:29:56 GMT
Github user alsorokin commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/246#discussion_r32515523
  
    --- 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 --
    
    If this is moved, then 'creating test app' should also be moved, but creating test app
before each test could significantly increase test run duration (289 -> 348 sec on my machine).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message