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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]