[
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16058352#comment-16058352
]
ASF GitHub Bot commented on CB-12361:
-------------------------------------
Github user purplecabbage commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/567#discussion_r123380130
--- Diff: spec-cordova/prepare.spec.js ---
@@ -17,175 +17,265 @@
under the License.
*/
-var shell = require('shelljs'),
- PlatformJson = require('cordova-common').PlatformJson,
- path = require('path'),
- util = require('../src/cordova/util'),
- prepare = require('../src/cordova/prepare'),
- lazy_load = require('../src/cordova/lazy_load'),
- ConfigParser = require('cordova-common').ConfigParser,
- platforms = require('../src/platforms/platforms'),
- HooksRunner = require('../src/hooks/HooksRunner'),
- xmlHelpers = require('cordova-common').xmlHelpers,
- et = require('elementtree'),
- Q = require('q');
+/* eslint-env jasmine */
-var project_dir = '/some/path';
-var supported_platforms = Object.keys(platforms).filter(function(p) {
return p != 'www'; });
-
-var TEST_XML = '<?xml version="1.0" encoding="UTF-8"?>\n' +
- '<widget xmlns = "http://www.w3.org/ns/widgets"\n' +
- ' xmlns:cdv = "http://cordova.apache.org/ns/1.0"\n' +
- ' id = "io.cordova.hellocordova"\n' +
- ' version = "0.0.1">\n' +
- ' <name>Hello Cordova</name>\n' +
- ' <description>\n' +
- ' A sample Apache Cordova application that responds to the
deviceready event.\n' +
- ' </description>\n' +
- ' <author href="http://cordova.io"
email="[email protected]">\n' +
- ' Apache Cordova Team\n' +
- ' </author>\n' +
- ' <content src="index.html" />\n' +
- ' <access origin="*" />\n' +
- ' <preference name="fullscreen" value="true" />\n' +
- ' <preference name="webviewbounce" value="true" />\n' +
- '</widget>\n';
+var path = require('path');
+var rewire = require('rewire');
+var util = require('../src/cordova/util');
+var cordova_config = require('../src/cordova/config');
+var prepare = rewire('../src/cordova/prepare');
+var restore = require('../src/cordova/restore-util');
+var platforms = require('../src/platforms/platforms');
+var HooksRunner = require('../src/hooks/HooksRunner');
+var Q = require('q');
+var PlatformJson = require('cordova-common').PlatformJson;
+var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
-describe('prepare command', function() {
- var is_cordova,
- cd_project_root,
- list_platforms,
- fire,
- parsers = {},
- find_plugins,
- cp,
- mkdir,
- load, platformApi, getPlatformApi;
+var project_dir = '/some/path';
+describe('cordova/prepare', function () {
+ let platform_api_prepare_mock;
--- End diff --
I am cool with `let|const|var`, my reservation is around `() =>` syntax as
I want to be sure everyone is using it correctly before it gets dumped all over
the place.
I kinda think this pr is not the place to start the conversion effort.
> Speed up cordova-lib tests
> --------------------------
>
> Key: CB-12361
> URL: https://issues.apache.org/jira/browse/CB-12361
> Project: Apache Cordova
> Issue Type: Improvement
> Components: cordova-lib
> Reporter: Steve Gill
> Assignee: Steve Gill
> Labels: cordova-next
>
> * Split out e2e tests into own folder
> * stub i/o and network requests
> * use local fixtures when possible & makes sense
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]