You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/12 08:40:29 UTC

[GitHub] [cordova-electron] timbru31 commented on a change in pull request #154: feature: support custom scheme & hostname

timbru31 commented on a change in pull request #154:
URL: https://github.com/apache/cordova-electron/pull/154#discussion_r439287475



##########
File path: tests/spec/unit/lib/SettingJsonParser.spec.js
##########
@@ -100,6 +101,50 @@ describe('Testing SettingJsonParser.js:', () => {
             expect(settingJsonParser.package.browserWindow.webPreferences.nodeIntegration).toBe(true);
         });
 
+        it('should set scheme and hostname to default when not defined.', () => {
+            options = { options: { release: true, argv: [] } };
+
+            SettingJsonParser.__set__('require', (file) => {
+                // return defaults
+                if (file.includes('cdv-electron-settings.json')) {
+                    return {
+                        browserWindow: {
+                            webPreferences: { }
+                        }
+                    };
+                }
+
+                return require(file);
+            });
+
+            settingJsonParser = new SettingJsonParser(locations.www).configure(cfgEmpty, options.options, false);
+
+            expect(settingJsonParser.package.scheme).toBe('file');
+            expect(settingJsonParser.package.hostname).toBe('localhost');
+        });
+
+        it('should set custom scheme and hostname from config.xml .', () => {

Review comment:
       ```suggestion
           it('should set custom scheme and hostname from config.xml.', () => {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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