You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/15 12:12:00 UTC
[jira] [Commented] (CB-14148) cordova platform ls shows nonsense
www ^3.12.0 platform
[ https://issues.apache.org/jira/browse/CB-14148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16580990#comment-16580990 ]
ASF GitHub Bot commented on CB-14148:
-------------------------------------
raphinesse commented on a change in pull request #620: CB-14148 remove nonsense "www" platform from listing
URL: https://github.com/apache/cordova-lib/pull/620#discussion_r210248094
##########
File path: spec/cordova/platforms/platforms.spec.js
##########
@@ -32,6 +32,29 @@ var PLATFORM_SYMLINK = path.join(os.tmpdir(), 'cordova_windows_symlink');
shell.ln('-sf', PLATFORM_WITH_API, PLATFORM_SYMLINK);
+describe('platforms object', function () {
+ it('should have getPlatformApi function as a property', function () {
+ expect(platforms.getPlatformApi).toBeDefined();
+ expect(typeof platforms.getPlatformApi).toBe('function');
+ });
+
+ it('should have correct number of platform properties', function () {
+ expect(Object.keys(platforms).length).toBe(5);
+ });
+
+ it('should include the supported platforms', function () {
+ expect(platforms.android).toBeDefined();
+ expect(platforms.browser).toBeDefined();
+ expect(platforms.ios).toBeDefined();
+ expect(platforms.osx).toBeDefined();
+ expect(platforms.windows).toBeDefined();
+ });
+
+ it('should *not* include nonsense "www" platform (CB-14148)', function () {
+ expect(platforms.www).not.toBeDefined();
+ });
Review comment:
I've been battling needlessly verbose tests. Would you be OK if we merge the last three tests to the following?
```js
it('should have all and only the supported platforms', function () {
expect(Object.keys(platforms)).toEqual(jasmine.arrayWithExactContents([
'android', 'browser', 'ios', 'osx', 'windows',
]));
});
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
> cordova platform ls shows nonsense www ^3.12.0 platform
> -------------------------------------------------------
>
> Key: CB-14148
> URL: https://issues.apache.org/jira/browse/CB-14148
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-cli, cordova-common, cordova-lib
> Reporter: Chris Brody
> Assignee: Chris Brody
> Priority: Minor
>
> As I already reported inĀ [apache/cordova-discuss#86|https://github.com/apache/cordova-discuss/issues/86] and saw someone else report in Slack:
> {code:bash}
> $ cordova --version
> 8.0.0
> {code}
> {code:bash}
> $ cordova platform ls
> Installed platforms:
>
> Available platforms:
> android ~7.0.0
> browser ~5.0.1
> ios ~4.5.4
> osx ~4.0.1
> windows ~5.0.0
> www ^3.12.0
> {code}
> If I would do {{cordova platform add www}}:
> {code:bash}
> $ cordova platform add www
> (node:10383) UnhandledPromiseRejectionWarning: CordovaError: Error: npm: Command failed with exit code 1 Error output:
> npm ERR! code ENOLOCAL
> npm ERR! Could not install from "www" as it does not contain a package.json file.
> npm ERR! A complete log of this run can be found in:
> npm ERR! /Users/brodybits/.npm/_logs/2018-01-04T04_21_59_700Z-debug.log
> at /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/cordova-fetch/index.js:104:29
> at _rejected (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:864:24)
> at /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:890:30
> at Promise.when (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:1142:31)
> at Promise.promise.promiseDispatch (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:808:41)
> at /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:624:44
> at runSingle (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:137:13)
> at flush (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:125:13)
> at process._tickCallback (internal/process/next_tick.js:150:11)
> (node:10383) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
> (node:10383) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org