This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-electron.git


The following commit(s) were added to refs/heads/master by this push:
     new 04de631  refactor: transform arrow functions & arrow returns (#121)
04de631 is described below

commit 04de631547c75d7c5e90c520b80ea93242478d5b
Author: エリス <[email protected]>
AuthorDate: Fri Dec 20 06:18:51 2019 +0900

    refactor: transform arrow functions & arrow returns (#121)
---
 bin/templates/cordova/Api.js                       |   2 +-
 bin/templates/cordova/lib/util.js                  |   2 +-
 bin/update                                         |  16 +-
 tests/spec/unit/Api.spec.js                        | 471 ++++++++++-----------
 .../spec/unit/templates/cordova/lib/build.spec.js  |  10 +-
 .../unit/templates/cordova/lib/prepare.spec.js     |  28 +-
 6 files changed, 260 insertions(+), 269 deletions(-)

diff --git a/bin/templates/cordova/Api.js b/bin/templates/cordova/Api.js
index 6c83e97..1ca3a11 100644
--- a/bin/templates/cordova/Api.js
+++ b/bin/templates/cordova/Api.js
@@ -344,7 +344,7 @@ class Api {
 // @todo create projectInstance and fulfill promise with it.
 Api.updatePlatform = () => Promise.resolve();
 
-Api.createPlatform = function (dest, config, options, events) {
+Api.createPlatform = (dest, config, options, events) => {
     events = setupEvents(events);
 
     const name = config ? config.name() : 'HelloCordova';
diff --git a/bin/templates/cordova/lib/util.js 
b/bin/templates/cordova/lib/util.js
index a6a9122..e8362b7 100644
--- a/bin/templates/cordova/lib/util.js
+++ b/bin/templates/cordova/lib/util.js
@@ -17,7 +17,7 @@
     under the License.
 */
 
-module.exports.deepMerge = function (mergeTo, mergeWith) {
+module.exports.deepMerge = (mergeTo, mergeWith) => {
     for (const property in mergeWith) {
         if (Object.prototype.toString.call(mergeWith[property]) === '[object 
Object]') {
             mergeTo[property] = module.exports.deepMerge((mergeTo[property] || 
{}), mergeWith[property]);
diff --git a/bin/update b/bin/update
index 304c0e2..f2e7c75 100644
--- a/bin/update
+++ b/bin/update
@@ -25,10 +25,14 @@ const update = require('./lib/update');
 if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) 
> -1) {
     update.help();
 } else {
-    update.run(process.argv).then(function () {
-        console.log('Successfully updated electron project.'); // won't happen 
.. it's not supported
-    }, function (err) {
-        console.error('Update failed due to', err);
-        process.exit(2);
-    });
+    update.run(process.argv)
+        .then(
+            () => {
+                console.log('Successfully updated electron project.'); // 
won't happen .. it's not supported
+            },
+            err => {
+                console.error('Update failed due to', err);
+                process.exit(2);
+            }
+        );
 }
diff --git a/tests/spec/unit/Api.spec.js b/tests/spec/unit/Api.spec.js
index 5f14846..d1a4f1a 100644
--- a/tests/spec/unit/Api.spec.js
+++ b/tests/spec/unit/Api.spec.js
@@ -110,9 +110,7 @@ describe('Api class', () => {
     describe('getPlatformInfo method', () => {
         beforeEach(() => {
             // Mocking require that is called to get version.
-            Api.__set__('require', () => {
-                return '1.0.0';
-            });
+            Api.__set__('require', () => '1.0.0');
         });
 
         afterEach(() => {
@@ -136,11 +134,9 @@ describe('Api class', () => {
         const prepareSpy = jasmine.createSpy('prepare');
         beforeEach(() => {
             // Mocking require that is called to get version.
-            Api.__set__('require', () => {
-                return {
-                    prepare: prepareSpy
-                };
-            });
+            Api.__set__('require', () => ({
+                prepare: prepareSpy
+            }));
         });
 
         afterEach(() => {
@@ -181,76 +177,78 @@ describe('Api class', () => {
             );
         });
 
-        it('empty plugin', () => api.addPlugin({
-            id: 'empty_plugin',
-            getPlatformsArray: () => { return ['electron']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => { return []; },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-                expect(dirExists(path.resolve(testProjectDir, 
'www'))).toBeTruthy();
-                expect(fileExists(path.resolve(testProjectDir, 
'electron.json'))).toBeTruthy();
-                expect(fileExists(path.resolve(testProjectDir, 'www', 
'cordova_plugins.js'))).toBeTruthy();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
-
-        it('asset plugin', () => api.addPlugin({
-            id: 'asset-plugin',
-            dir: pluginFixture,
-            getPlatformsArray: () => { return ['electron']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => {
-                return [{
+        it('empty plugin', () => {
+            return api.addPlugin({
+                id: 'empty_plugin',
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                    expect(dirExists(path.resolve(testProjectDir, 
'www'))).toBeTruthy();
+                    expect(fileExists(path.resolve(testProjectDir, 
'electron.json'))).toBeTruthy();
+                    expect(fileExists(path.resolve(testProjectDir, 'www', 
'cordova_plugins.js'))).toBeTruthy();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
+
+        it('asset plugin', () => {
+            return api.addPlugin({
+                id: 'asset-plugin',
+                dir: pluginFixture,
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [{
                     itemType: 'asset',
                     src: 'src/electron/sample.json',
                     target: 'js/sample.json'
-                }];
-            },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-                expect(fileExists(path.resolve(testProjectDir, 'www', 'js', 
'sample.json'))).toBeTruthy();
-                expect(readJson(path.resolve(testProjectDir, 'www', 'js', 
'sample.json')).title).toEqual('sample');
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
-
-        it('js-module plugin', () => api.addPlugin({
-            id: 'module-plugin',
-            dir: pluginFixture,
-            getPlatformsArray: () => { return ['electron']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => { return []; },
-            getJsModules: (platform) => {
-                return [{
+                }],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                    expect(fileExists(path.resolve(testProjectDir, 'www', 
'js', 'sample.json'))).toBeTruthy();
+                    expect(readJson(path.resolve(testProjectDir, 'www', 'js', 
'sample.json')).title).toEqual('sample');
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
+
+        it('js-module plugin', () => {
+            return api.addPlugin({
+                id: 'module-plugin',
+                dir: pluginFixture,
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [],
+                getJsModules: platform => [{
                     itemType: 'js-module',
                     name: 'testmodule',
                     src: 'www/plugin.js',
                     clobbers: ['ModulePlugin.clobbers'],
                     merges: ['ModulePlugin.merges'],
                     runs: true
-                }];
-            },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-                expect(fileExists(path.resolve(testProjectDir, 'www', 
'plugins', 'module-plugin', 'www', 'plugin.js'))).toBeTruthy();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
+                }],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                    expect(fileExists(path.resolve(testProjectDir, 'www', 
'plugins', 'module-plugin', 'www', 'plugin.js'))).toBeTruthy();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
 
         it('unrecognized type plugin', () => {
             const _events = api.events;
@@ -262,15 +260,13 @@ describe('Api class', () => {
             return api.addPlugin({
                 id: 'unrecognized-plugin',
                 dir: pluginFixture,
-                getPlatformsArray: () => { return ['electron']; },
-                getFilesAndFrameworks: (platform) => { return []; },
-                getAssets: (platform) => {
-                    return [{
-                        itemType: 'unrecognized'
-                    }];
-                },
-                getJsModules: (platform) => { return []; },
-                getConfigFiles: (platform) => { return []; }
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [{
+                    itemType: 'unrecognized'
+                }],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
             }, { }).then(
                 (result) => {
                     
expect(emitSpy.calls.argsFor(0)[1]).toContain('unrecognized');
@@ -284,46 +280,48 @@ describe('Api class', () => {
             );
         });
 
-        it('source-file type plugin', () => api.addPlugin({
-            id: 'source-file-plugin',
-            dir: pluginFixture,
-            getPlatformsArray: () => { return ['electron']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => {
-                return [{
+        it('source-file type plugin', () => {
+            return api.addPlugin({
+                id: 'source-file-plugin',
+                dir: pluginFixture,
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [{
                     itemType: 'source-file'
-                }];
-            },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-                expect(logs.verbose.some((message) => { return message === 
'source-file.install is currently not supported for electron'; })).toBeTruthy();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
-
-        it('empty plugin with browser platform', () => api.addPlugin({
-            id: 'empty_plugin',
-            getPlatformsArray: () => { return ['browser']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => { return []; },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-                expect(dirExists(path.resolve(testProjectDir, 
'www'))).toBeTruthy();
-                expect(fileExists(path.resolve(testProjectDir, 
'electron.json'))).toBeTruthy();
-                expect(fileExists(path.resolve(testProjectDir, 'www', 
'cordova_plugins.js'))).toBeTruthy();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
+                }],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                    expect(logs.verbose.some(message => message === 
'source-file.install is currently not supported for electron')).toBeTruthy();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
+
+        it('empty plugin with browser platform', () => {
+            return api.addPlugin({
+                id: 'empty_plugin',
+                getPlatformsArray: () => ['browser'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                    expect(dirExists(path.resolve(testProjectDir, 
'www'))).toBeTruthy();
+                    expect(fileExists(path.resolve(testProjectDir, 
'electron.json'))).toBeTruthy();
+                    expect(fileExists(path.resolve(testProjectDir, 'www', 
'cordova_plugins.js'))).toBeTruthy();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
     });
 
     /**
@@ -351,21 +349,23 @@ describe('Api class', () => {
             expect(typeof api.removePlugin).toBe('function');
         });
 
-        it('remove empty plugin', () => api.removePlugin({
-            id: 'empty_plugin',
-            getPlatformsArray: () => { return ['electron']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => { return []; },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
+        it('remove empty plugin', () => {
+            return api.removePlugin({
+                id: 'empty_plugin',
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
 
         it('asset plugin', () => {
             fs.ensureDirSync(path.resolve(testProjectDir, 'www', 'js'));
@@ -373,17 +373,15 @@ describe('Api class', () => {
             return api.removePlugin({
                 id: 'empty_plugin',
                 dir: pluginFixture,
-                getPlatformsArray: () => { return ['electron']; },
-                getFilesAndFrameworks: (platform) => { return []; },
-                getAssets: (platform) => {
-                    return [{
-                        itemType: 'asset',
-                        src: 'src/electron/sample.json',
-                        target: 'js/sample.json'
-                    }];
-                },
-                getJsModules: (platform) => { return []; },
-                getConfigFiles: (platform) => { return []; }
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [{
+                    itemType: 'asset',
+                    src: 'src/electron/sample.json',
+                    target: 'js/sample.json'
+                }],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
             }, { }).then(
                 (result) => {
                     expect(result).not.toBeDefined();
@@ -402,20 +400,18 @@ describe('Api class', () => {
             return api.removePlugin({
                 id: 'module-plugin',
                 dir: pluginFixture,
-                getPlatformsArray: () => { return ['electron']; },
-                getFilesAndFrameworks: (platform) => { return []; },
-                getAssets: (platform) => { return []; },
-                getJsModules: (platform) => {
-                    return [{
-                        itemType: 'js-module',
-                        name: 'testmodule',
-                        src: 'www/plugin.js',
-                        clobbers: ['ModulePlugin.clobbers'],
-                        merges: ['ModulePlugin.merges'],
-                        runs: true
-                    }];
-                },
-                getConfigFiles: (platform) => { return []; }
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [],
+                getJsModules: platform => [{
+                    itemType: 'js-module',
+                    name: 'testmodule',
+                    src: 'www/plugin.js',
+                    clobbers: ['ModulePlugin.clobbers'],
+                    merges: ['ModulePlugin.merges'],
+                    runs: true
+                }],
+                getConfigFiles: platform => []
             }, { }).then(
                 (result) => {
                     expect(result).not.toBeDefined();
@@ -427,64 +423,66 @@ describe('Api class', () => {
             );
         });
 
-        it('unrecognized type plugin', () => api.removePlugin({
-            id: 'unrecognized-plugin',
-            dir: pluginFixture,
-            getPlatformsArray: () => { return ['electron']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => {
-                return [{
+        it('unrecognized type plugin', () => {
+            return api.removePlugin({
+                id: 'unrecognized-plugin',
+                dir: pluginFixture,
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [{
                     itemType: 'unrecognized'
-                }];
-            },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
-
-        it('source-file type plugin', () => api.removePlugin({
-            id: 'source-file-plugin',
-            dir: pluginFixture,
-            getPlatformsArray: () => { return ['electron']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => {
-                return [{
+                }],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
+
+        it('source-file type plugin', () => {
+            return api.removePlugin({
+                id: 'source-file-plugin',
+                dir: pluginFixture,
+                getPlatformsArray: () => ['electron'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [{
                     itemType: 'source-file'
-                }];
-            },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-                expect(logs.verbose.some((message) => { return message === 
'source-file.uninstall is currently not supported for electron'; 
})).toBeTruthy();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
-
-        it('remove empty plugin with browser platform', () => 
api.removePlugin({
-            id: 'empty_plugin',
-            getPlatformsArray: () => { return ['browser']; },
-            getFilesAndFrameworks: (platform) => { return []; },
-            getAssets: (platform) => { return []; },
-            getJsModules: (platform) => { return []; },
-            getConfigFiles: (platform) => { return []; }
-        }, { }).then(
-            (result) => {
-                expect(result).not.toBeDefined();
-            },
-            (error) => {
-                fail('Unwanted code branch: ' + error);
-            }
-        ));
+                }],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                    expect(logs.verbose.some(message => message === 
'source-file.uninstall is currently not supported for electron')).toBeTruthy();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
+
+        it('remove empty plugin with browser platform', () => {
+            return api.removePlugin({
+                id: 'empty_plugin',
+                getPlatformsArray: () => ['browser'],
+                getFilesAndFrameworks: platform => [],
+                getAssets: platform => [],
+                getJsModules: platform => [],
+                getConfigFiles: platform => []
+            }, { }).then(
+                (result) => {
+                    expect(result).not.toBeDefined();
+                },
+                (error) => {
+                    fail('Unwanted code branch: ' + error);
+                }
+            );
+        });
     });
 
     describe('updatePlatform method', () => {
@@ -511,19 +509,16 @@ describe('Api class', () => {
          * @todo improve createPlatform to test actual created platforms.
          */
         it('should export static createPlatform function', () => {
-            return Api.createPlatform(tmpDir).then(
-                (results) => {
+            return Api.createPlatform(tmpDir)
+                .then((results) => {
                     
expect(results.constructor.name).toBe(api.constructor.name);
-                }
-            );
+                });
         });
 
         it('should emit createPlatform not callable when error occurs.', () => 
{
-            Api.__set__('require', () => {
-                return {
-                    createProject: () => { throw new Error('Some Random 
Error'); }
-                };
-            });
+            Api.__set__('require', () => ({
+                createProject: () => { throw new Error('Some Random Error'); }
+            }));
 
             expect(() => 
Api.createPlatform(tmpDir)).toThrowError(/createPlatform is not callable from 
the electron project API/);
 
@@ -535,11 +530,9 @@ describe('Api class', () => {
         const runSpy = jasmine.createSpy('run');
         beforeEach(() => {
             // Mocking require that is called to get version.
-            Api.__set__('require', () => {
-                return {
-                    run: { call: runSpy }
-                };
-            });
+            Api.__set__('require', () => ({
+                run: { call: runSpy }
+            }));
         });
 
         afterEach(() => {
@@ -557,11 +550,9 @@ describe('Api class', () => {
         const runSpy = jasmine.createSpy('run');
         beforeEach(() => {
             // Mocking require that is called to get version.
-            Api.__set__('require', () => {
-                return {
-                    run: runSpy
-                };
-            });
+            Api.__set__('require', () => ({
+                run: runSpy
+            }));
         });
 
         afterEach(() => {
@@ -579,11 +570,9 @@ describe('Api class', () => {
         const cleanSpy = jasmine.createSpy('clean');
         beforeEach(() => {
             // Mocking require that is called to get version.
-            Api.__set__('require', () => {
-                return {
-                    run: cleanSpy
-                };
-            });
+            Api.__set__('require', () => ({
+                run: cleanSpy
+            }));
         });
 
         afterEach(() => {
@@ -601,11 +590,9 @@ describe('Api class', () => {
         const requirementsSpy = jasmine.createSpy('requirements');
         beforeEach(() => {
             // Mocking require that is called to get version.
-            Api.__set__('require', () => {
-                return {
-                    run: requirementsSpy
-                };
-            });
+            Api.__set__('require', () => ({
+                run: requirementsSpy
+            }));
         });
 
         afterEach(() => {
diff --git a/tests/spec/unit/templates/cordova/lib/build.spec.js 
b/tests/spec/unit/templates/cordova/lib/build.spec.js
index 6d7aed8..d05f53c 100644
--- a/tests/spec/unit/templates/cordova/lib/build.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/build.spec.js
@@ -652,7 +652,7 @@ describe('Testing build.js:', () => {
 
             expect(existsSyncSpy).toHaveBeenCalled();
             expect(requireSpy).toHaveBeenCalled();
-            expect(function () { electronBuilder.configureUserBuildSettings(); 
}).toThrow(
+            expect(() => { electronBuilder.configureUserBuildSettings(); 
}).toThrow(
                 new Error('The platform "mac" contains an invalid property. 
Valid properties are: package, arch, signing')
             );
         });
@@ -1194,7 +1194,7 @@ describe('Testing build.js:', () => {
 
             expect(existsSyncSpy).toHaveBeenCalled();
 
-            expect(function () { 
electronBuilder.fetchPlatformDefaults('name'); }).toThrow(new Error('Your 
platform "name" is not supported as a default target platform for Electron.'));
+            expect(() => { electronBuilder.fetchPlatformDefaults('name'); 
}).toThrow(new Error('Your platform "name" is not supported as a default target 
platform for Electron.'));
         });
 
         it('should __appendUserSigning linux signing.', () => {
@@ -1652,9 +1652,9 @@ describe('Testing build.js:', () => {
 
             // create spies
             const buildSpy = jasmine.createSpy('build');
-            build.__set__('require', () => {
-                return { build: buildSpy };
-            });
+            build.__set__('require', () => ({
+                build: buildSpy
+            }));
 
             electronBuilder = new ElectronBuilder(buildOptions, api).build();
 
diff --git a/tests/spec/unit/templates/cordova/lib/prepare.spec.js 
b/tests/spec/unit/templates/cordova/lib/prepare.spec.js
index 83591c1..e0adba5 100644
--- a/tests/spec/unit/templates/cordova/lib/prepare.spec.js
+++ b/tests/spec/unit/templates/cordova/lib/prepare.spec.js
@@ -223,8 +223,8 @@ describe('Testing prepare.js:', () => {
                 // Create API instance and mock for test case.
                 const api = new Api(null, '', '');
                 api.events = { emit: emitSpy };
-                api.parser.update_www = () => { return this; };
-                api.parser.update_project = () => { return this; };
+                api.parser.update_www = () => this;
+                api.parser.update_project = () => this;
 
                 const defaultConfigPathMock = 
path.join(api.locations.platformRootDir, 'cordova', 'defaults.xml');
                 const ownConfigPathMock = api.locations.configXml;
@@ -279,8 +279,8 @@ describe('Testing prepare.js:', () => {
                 // Create API instance and mock for test case.
                 const api = new Api(null, '', '');
                 api.events = { emit: emitSpy };
-                api.parser.update_www = () => { return this; };
-                api.parser.update_project = () => { return this; };
+                api.parser.update_www = () => this;
+                api.parser.update_project = () => this;
 
                 const defaultConfigPathMock = 
path.join(api.locations.platformRootDir, 'cordova', 'defaults.xml');
 
@@ -325,8 +325,8 @@ describe('Testing prepare.js:', () => {
                 // Create API instance and mock for test case.
                 const api = new Api(null, '', '');
                 api.events = { emit: emitSpy };
-                api.parser.update_www = () => { return this; };
-                api.parser.update_project = () => { return this; };
+                api.parser.update_www = () => this;
+                api.parser.update_project = () => this;
 
                 const defaultConfigPathMock = 
path.join(api.locations.platformRootDir, 'cordova', 'defaults.xml');
                 const copySyncSpy = jasmine.createSpy('copySync');
@@ -370,8 +370,8 @@ describe('Testing prepare.js:', () => {
                 // Create API instance and mock for test case.
                 const api = new Api(null, '', '');
                 api.events = { emit: emitSpy };
-                api.parser.update_www = () => { return this; };
-                api.parser.update_project = () => { return this; };
+                api.parser.update_www = () => this;
+                api.parser.update_project = () => this;
 
                 const defaultConfigPathMock = 
path.join(api.locations.platformRootDir, 'cordova', 'defaults.xml');
                 const ownConfigPathMock = api.locations.configXml;
@@ -426,8 +426,8 @@ describe('Testing prepare.js:', () => {
                 // Create API instance and mock for test case.
                 const api = new Api(null, '', '');
                 api.events = { emit: emitSpy };
-                api.parser.update_www = () => { return this; };
-                api.parser.update_project = () => { return this; };
+                api.parser.update_www = () => this;
+                api.parser.update_project = () => this;
 
                 const defaultConfigPathMock = 
path.join(api.locations.platformRootDir, 'cordova', 'defaults.xml');
                 const ownConfigPathMock = api.locations.configXml;
@@ -483,8 +483,8 @@ describe('Testing prepare.js:', () => {
                 // Create API instance and mock for test case.
                 const api = new Api(null, '', '');
                 api.events = { emit: emitSpy };
-                api.parser.update_www = () => { return this; };
-                api.parser.update_project = () => { return this; };
+                api.parser.update_www = () => this;
+                api.parser.update_project = () => this;
 
                 const srcManifestPathMock = 
path.join(cordovaProject.locations.www, 'manifest.json');
                 const manifestPathMock = path.join(api.locations.www, 
'manifest.json');
@@ -539,8 +539,8 @@ describe('Testing prepare.js:', () => {
                 // Create API instance and mock for test case.
                 const api = new Api(null, '', '');
                 api.events = { emit: emitSpy };
-                api.parser.update_www = () => { return this; };
-                api.parser.update_project = () => { return this; };
+                api.parser.update_www = () => this;
+                api.parser.update_project = () => this;
 
                 const srcManifestPathMock = 
path.join(cordovaProject.locations.www, 'manifest.json');
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to