You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2020/01/12 12:10:17 UTC

[cordova-lib] branch master updated: test(e2e): improve HooksRunner.spec (#825)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 214dca1  test(e2e): improve HooksRunner.spec (#825)
214dca1 is described below

commit 214dca16813bb5c9224750b10ec1d9e4979c5256
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Sun Jan 12 13:10:10 2020 +0100

    test(e2e): improve HooksRunner.spec (#825)
    
    * test(HooksRunner): properly setup temp dir
    
    * test(HooksRunner): faster & simpler project setup
    
    This is possible since we don't need an installed platform anymore
    since we have dropped Test#012. We also needed to stop using
    `util.preProcessOptions` because that expects platforms too. However,
    its usage was irrelevant for the tests anyway.
    
    * test(HooksRunner): remove unused hooks
    
    * test(HooksRunner): reduce number of fixture files
    
    * test(HooksRunner): make hook fixtures executable
    
    * test(HooksRunner): cleanup & clarify "nohooks" tests
    
    This also groups all "nohooks" tests in one describe block.
    
    * test(HooksRunner): move tests to suitable block
    
    * test(HooksRunner): only pass options where needed
    
    * test(HooksRunner): cleanup "event handler" tests
    
    - proper common test setup
    - improve test descriptions
    - test what the descriptions say
    - replace the two last tests with a useful one
---
 integration-tests/HooksRunner.spec.js              | 288 +++++++++------------
 .../scripts/android/androidBeforeInstall.js        |   4 -
 .../com.plugin.withhooks/scripts/beforeInstall.bat |   2 -
 .../com.plugin.withhooks/scripts/beforeInstall.sh  |   1 -
 .../scripts/beforeInstall01.js                     |   4 -
 .../com.plugin.withhooks/scripts/beforeInstall2.js |   4 -
 .../scripts/beforeUninstall.js                     |   4 -
 .../scripts/windows/windowsBeforeInstall.js        |   4 -
 spec/cordova/fixtures/projWithHooks/config.xml     |  12 -
 .../fixtures/projWithHooks/merges/.gitignore       |   0
 .../fixtures/projWithHooks/plugins/.gitignore      |   0
 .../android/appAndroidBeforePluginInstall.js       |   4 -
 .../scripts/appBeforePluginInstall.js              |   4 -
 .../windows/appWindowsBeforePluginInstall.js       |   4 -
 spec/cordova/fixtures/projWithHooks/www/config.xml |  14 -
 .../fixtures/projWithHooks/www/css/index.css       | 115 --------
 .../fixtures/projWithHooks/www/img/logo.png        | Bin 21814 -> 0 bytes
 spec/cordova/fixtures/projWithHooks/www/index.html |  43 ---
 .../cordova/fixtures/projWithHooks/www/js/index.js |  50 ----
 spec/cordova/fixtures/projWithHooks/www/spec.html  |  68 -----
 .../android/appAndroidBeforeBuild.bat              |   0
 .../android/appAndroidBeforeBuild.js               |   0
 .../android/appAndroidBeforeBuild.sh               |   0
 .../scripts => projectHooks}/appBeforeBuild02.js   |   0
 .../scripts => projectHooks}/appBeforeBuild1.bat   |   0
 .../scripts => projectHooks}/appBeforeBuild1.sh    |   0
 .../scripts => projectHooks}/fail.js               |   2 +-
 .../scripts => projectHooks}/orderLogger.js        |   0
 .../windows/appWindowsBeforeBuild.bat              |   0
 .../windows/appWindowsBeforeBuild.js               |   0
 .../windows/appWindowsBeforeBuild.sh               |   0
 31 files changed, 117 insertions(+), 510 deletions(-)

diff --git a/integration-tests/HooksRunner.spec.js b/integration-tests/HooksRunner.spec.js
index 3d176cc..6375748 100644
--- a/integration-tests/HooksRunner.spec.js
+++ b/integration-tests/HooksRunner.spec.js
@@ -20,74 +20,39 @@
 const path = require('path');
 const fs = require('fs-extra');
 const delay = require('delay');
-const globby = require('globby');
 const et = require('elementtree');
 
 const HooksRunner = require('../src/hooks/HooksRunner');
-const cordovaUtil = require('../src/cordova/util');
 const cordova = require('../src/cordova/cordova');
-const { tmpDir, testPlatform } = require('../spec/helpers');
+const { tmpDir } = require('../spec/helpers');
 const { PluginInfo, ConfigParser } = require('cordova-common');
-const { Q_chainmap } = require('../src/util/promise-util');
 
-const tmp = tmpDir('hooks_test');
-const project = path.join(tmp, 'project');
-const preparedProject = path.join(tmp, 'preparedProject');
 const ext = process.platform === 'win32' ? 'bat' : 'sh';
 const fixtures = path.join(__dirname, '../spec/cordova/fixtures');
 
-const testPlugin = 'com.plugin.withhooks';
-const testPluginFixture = path.join(fixtures, 'plugins', testPlugin);
-const testPluginInstalledPath = path.join(project, 'plugins', testPlugin);
-
 describe('HooksRunner', function () {
-    let hooksRunner, hookOptions;
+    let tmp, project, hooksRunner;
 
     // This prepares a project that we will copy and use for all tests
-    beforeAll(function () {
-        // Copy project fixture
-        const projectFixture = path.join(fixtures, 'projWithHooks');
-        fs.copySync(projectFixture, preparedProject);
-
-        // Ensure scripts are executable
-        globby.sync(['scripts/**'], {
-            cwd: preparedProject, absolute: true
-        }).forEach(f => fs.chmodSync(f, 0o755));
-
-        // Add the testing platform and plugin to our project
-        process.chdir(preparedProject);
-        return cordova.platform('add', testPlatform)
-            .then(() => fs.copy(
-                testPluginFixture,
-                path.join(preparedProject, 'plugins', testPlugin)
-            ));
-    }, 60 * 1000);
-
-    beforeEach(function () {
-        // Reset our test project
-        // We are linking node_modules to improve performance
-        process.chdir(__dirname); // Avoid EBUSY on Windows
-        fs.removeSync(project);
-        fs.copySync(preparedProject, project, {
-            filter: p => path.basename(p) !== 'node_modules'
-        });
-        const platformModules = 'platforms/android/cordova/node_modules';
-        fs.symlinkSync(path.join(preparedProject, platformModules),
-            path.join(project, platformModules), 'junction');
+    beforeEach(() => {
+        tmp = tmpDir('hooks_test');
+        project = path.join(tmp, 'project');
+
+        // Copy base project fixture
+        fs.copySync(path.join(fixtures, 'basePkgJson'), project);
+
+        // Copy project hooks
+        const hooksDir = path.join(fixtures, 'projectHooks');
+        fs.copySync(hooksDir, path.join(project, 'scripts'));
 
         // Change into our project directory
         process.chdir(project);
         process.env.PWD = project; // this is used by cordovaUtil.isCordova
 
-        hookOptions = {
-            projectRoot: project,
-            cordova: cordovaUtil.preProcessOptions()
-        };
-
         hooksRunner = new HooksRunner(project);
     });
 
-    afterAll(function () {
+    afterEach(() => {
         process.chdir(path.join(__dirname, '..')); // Non e2e tests assume CWD is repo root.
         fs.removeSync(tmp);
     });
@@ -102,9 +67,10 @@ describe('HooksRunner', function () {
 
     describe('fire method', function () {
         const test_event = 'before_build';
-        const hooksOrderFile = path.join(project, 'hooks_order.txt');
+        let hooksOrderFile;
 
         beforeEach(function () {
+            hooksOrderFile = path.join(project, 'hooks_order.txt');
             fs.removeSync(hooksOrderFile);
         });
 
@@ -122,32 +88,6 @@ describe('HooksRunner', function () {
             expect(hooksOrder).toEqual(sortedHooksOrder);
         }
 
-        const BASE_HOOKS = `
-            <widget xmlns="http://www.w3.org/ns/widgets">
-                <hook type="before_build" src="scripts/appBeforeBuild1.${ext}" />
-                <hook type="before_build" src="scripts/appBeforeBuild02.js" />
-                <hook type="before_plugin_install" src="scripts/appBeforePluginInstall.js" />
-            </widget>
-        `;
-        const WINDOWS_HOOKS = `
-            <widget xmlns="http://www.w3.org/ns/widgets">
-                <platform name="windows">
-                    <hook type="before_build" src="scripts/windows/appWindowsBeforeBuild.${ext}" />
-                    <hook type="before_build" src="scripts/windows/appWindowsBeforeBuild.js" />
-                    <hook type="before_plugin_install" src="scripts/windows/appWindowsBeforePluginInstall.js" />
-                </platform>
-            </widget>
-        `;
-        const ANDROID_HOOKS = `
-            <widget xmlns="http://www.w3.org/ns/widgets">
-                <platform name="android">
-                    <hook type="before_build" src="scripts/android/appAndroidBeforeBuild.${ext}" />
-                    <hook type="before_build" src="scripts/android/appAndroidBeforeBuild.js" />
-                    <hook type="before_plugin_install" src="scripts/android/appAndroidBeforePluginInstall.js" />
-                </platform>
-            </widget>
-        `;
-
         function addHooks (hooksXml, doc) {
             const hooks = et.parse(hooksXml);
             for (const el of hooks.getroot().findall('./*')) {
@@ -155,17 +95,40 @@ describe('HooksRunner', function () {
             }
         }
 
-        function addHooksToConfig (hooksXml) {
-            const config = new ConfigParser(path.join(project, 'config.xml'));
-            addHooks(hooksXml, config.doc);
-            config.write();
-        }
-
         describe('application hooks', function () {
+            const BASE_HOOKS = `
+                <widget xmlns="http://www.w3.org/ns/widgets">
+                    <hook type="before_build" src="scripts/appBeforeBuild1.${ext}" />
+                    <hook type="before_build" src="scripts/appBeforeBuild02.js" />
+                </widget>
+            `;
+            const WINDOWS_HOOKS = `
+                <widget xmlns="http://www.w3.org/ns/widgets">
+                    <platform name="windows">
+                        <hook type="before_build" src="scripts/windows/appWindowsBeforeBuild.${ext}" />
+                        <hook type="before_build" src="scripts/windows/appWindowsBeforeBuild.js" />
+                    </platform>
+                </widget>
+            `;
+            const ANDROID_HOOKS = `
+                <widget xmlns="http://www.w3.org/ns/widgets">
+                    <platform name="android">
+                        <hook type="before_build" src="scripts/android/appAndroidBeforeBuild.${ext}" />
+                        <hook type="before_build" src="scripts/android/appAndroidBeforeBuild.js" />
+                    </platform>
+                </widget>
+            `;
+
+            function addHooksToConfig (hooksXml) {
+                const config = new ConfigParser(path.join(project, 'config.xml'));
+                addHooks(hooksXml, config.doc);
+                config.write();
+            }
+
             it('Test 006 : should execute hook scripts serially from config.xml', function () {
                 addHooksToConfig(BASE_HOOKS);
 
-                return hooksRunner.fire(test_event, hookOptions)
+                return hooksRunner.fire(test_event)
                     .then(checkHooksOrderFile);
             });
 
@@ -173,7 +136,7 @@ describe('HooksRunner', function () {
                 addHooksToConfig(BASE_HOOKS);
                 addHooksToConfig(WINDOWS_HOOKS);
 
-                return hooksRunner.fire(test_event, hookOptions)
+                return hooksRunner.fire(test_event)
                     .then(checkHooksOrderFile);
             });
 
@@ -181,7 +144,7 @@ describe('HooksRunner', function () {
                 addHooksToConfig(BASE_HOOKS);
                 addHooksToConfig(WINDOWS_HOOKS);
                 addHooksToConfig(ANDROID_HOOKS);
-                hookOptions.cordova.platforms = ['android'];
+                const hookOptions = { cordova: { platforms: ['android'] } };
 
                 return hooksRunner.fire(test_event, hookOptions).then(function () {
                     checkHooksOrderFile();
@@ -192,15 +155,30 @@ describe('HooksRunner', function () {
                     expect(getActualHooksOrder()).toEqual(expectedResults);
                 });
             });
+
+            it('Test 023 : should error if any hook fails', function () {
+                const FAIL_HOOK = `
+                    <widget xmlns="http://www.w3.org/ns/widgets">
+                        <hook type="fail" src="scripts/fail.js" />
+                    </widget>
+                `;
+                addHooksToConfig(FAIL_HOOK);
+
+                return hooksRunner.fire('fail').then(function () {
+                    fail('Expected promise to be rejected');
+                }, function (err) {
+                    expect(err).toEqual(jasmine.any(Error));
+                });
+            });
+
+            it('Test 024 : should not error if the hook is unrecognized', function () {
+                return hooksRunner.fire('CLEAN YOUR SHORTS GODDAMNIT LIKE A BIG BOY!');
+            });
         });
 
         describe('plugin hooks', function () {
             const PLUGIN_BASE_HOOKS = `
                 <widget xmlns="http://www.w3.org/ns/widgets">
-                    <hook type="before_plugin_install" src="scripts/beforeInstall01.js" />
-                    <hook type="before_plugin_install" src="scripts/beforeInstall2.js" />
-                    <hook type="before_plugin_install" src="scripts/beforeInstall.${ext}" />
-                    <hook type="before_plugin_uninstall" src="scripts/beforeUninstall.js" />
                     <hook type="before_build" src="scripts/beforeBuild.js" />
                     <hook type="before_build" src="scripts/beforeBuild.${ext}" />
                 </widget>
@@ -208,7 +186,6 @@ describe('HooksRunner', function () {
             const PLUGIN_WINDOWS_HOOKS = `
                 <widget xmlns="http://www.w3.org/ns/widgets">
                     <platform name="windows">
-                        <hook type="before_plugin_install" src="scripts/windows/windowsBeforeInstall.js" />
                         <hook type="before_build" src="scripts/windows/windowsBeforeBuild.js" />
                     </platform>
                 </widget>
@@ -216,11 +193,19 @@ describe('HooksRunner', function () {
             const PLUGIN_ANDROID_HOOKS = `
                 <widget xmlns="http://www.w3.org/ns/widgets">
                     <platform name="android">
-                        <hook type="before_plugin_install" src="scripts/android/androidBeforeInstall.js" />
                         <hook type="before_build" src="scripts/android/androidBeforeBuild.js" />
                     </platform>
                 </widget>
             `;
+            const testPlugin = 'com.plugin.withhooks';
+            const testPluginFixture = path.join(fixtures, 'plugins', testPlugin);
+            let testPluginInstalledPath;
+
+            beforeEach(() => {
+                // Add the test plugin to our project
+                testPluginInstalledPath = path.join(project, 'plugins', testPlugin);
+                fs.copySync(testPluginFixture, testPluginInstalledPath);
+            });
 
             function addHooksToPlugin (hooksXml) {
                 const config = new PluginInfo(testPluginInstalledPath);
@@ -233,7 +218,7 @@ describe('HooksRunner', function () {
             it('Test 009 : should execute hook scripts serially from plugin.xml', function () {
                 addHooksToPlugin(PLUGIN_BASE_HOOKS);
 
-                return hooksRunner.fire(test_event, hookOptions)
+                return hooksRunner.fire(test_event)
                     .then(checkHooksOrderFile);
             });
 
@@ -241,19 +226,15 @@ describe('HooksRunner', function () {
                 addHooksToPlugin(PLUGIN_BASE_HOOKS);
                 addHooksToPlugin(PLUGIN_WINDOWS_HOOKS);
 
-                return hooksRunner.fire(test_event, hookOptions)
+                return hooksRunner.fire(test_event)
                     .then(checkHooksOrderFile);
             });
 
             it('Test 011 : should filter hook scripts from plugin.xml by platform', function () {
-                // Make scripts executable
-                globby.sync('scripts/**', { cwd: testPluginInstalledPath, absolute: true })
-                    .forEach(f => fs.chmodSync(f, 0o755));
-
                 addHooksToPlugin(PLUGIN_BASE_HOOKS);
                 addHooksToPlugin(PLUGIN_WINDOWS_HOOKS);
                 addHooksToPlugin(PLUGIN_ANDROID_HOOKS);
-                hookOptions.cordova.platforms = ['android'];
+                const hookOptions = { cordova: { platforms: ['android'] } };
 
                 return hooksRunner.fire(test_event, hookOptions).then(function () {
                     checkHooksOrderFile();
@@ -264,76 +245,69 @@ describe('HooksRunner', function () {
                     expect(getActualHooksOrder()).toEqual(expectedResults);
                 });
             });
+        });
 
-            it('Test 013 : should not execute the designated hook when --nohooks option specifies the exact hook name', function () {
-                hookOptions.nohooks = ['before_build'];
+        describe('nohooks option', () => {
+            it('Test 013 : should not execute the designated hook when --nohooks option specifies the exact hook name', async () => {
+                const hookOptions = { nohooks: [test_event] };
 
-                return hooksRunner.fire(test_event, hookOptions).then(function (msg) {
-                    expect(msg).toBeDefined();
-                    expect(msg).toBe('hook before_build is disabled.');
-                });
+                expect(await hooksRunner.fire(test_event, hookOptions))
+                    .toBe('hook before_build is disabled.');
             });
 
-            it('Test 014 : should not execute a set of matched hooks when --nohooks option specifies the hook pattern.', function () {
-                var test_events = ['before_build', 'after_plugin_add', 'before_platform_rm', 'before_prepare'];
-                hookOptions.nohooks = ['before*'];
-
-                return Q_chainmap(test_events, e => {
-                    return hooksRunner.fire(e, hookOptions).then(msg => {
-                        if (e === 'after_plugin_add') {
-                            expect(msg).toBeUndefined();
-                        } else {
-                            expect(msg).toBeDefined();
-                            expect(msg).toBe(`hook ${e} is disabled.`);
-                        }
-                    });
-                });
+            it('Test 014 : should not execute matched hooks when --nohooks option specifies a hook pattern', async () => {
+                const hookOptions = { nohooks: ['ba'] };
+
+                for (const e of ['foo', 'bar', 'baz']) {
+                    expect(await hooksRunner.fire(e, hookOptions))
+                        .toBe(e === 'foo' ? undefined : `hook ${e} is disabled.`);
+                }
             });
 
-            it('Test 015 : should not execute all hooks when --nohooks option specifies .', function () {
-                var test_events = ['before_build', 'after_plugin_add', 'before_platform_rm', 'before_prepare'];
-                hookOptions.nohooks = ['.'];
+            it('Test 015 : should not execute any hooks when --nohooks option specifies .', async () => {
+                const hookOptions = { nohooks: ['.'] };
 
-                return Q_chainmap(test_events, e => {
-                    return hooksRunner.fire(e, hookOptions).then(msg => {
-                        expect(msg).toBeDefined();
-                        expect(msg).toBe(`hook ${e} is disabled.`);
-                    });
-                });
+                for (const e of ['foo', 'bar', 'baz']) {
+                    expect(await hooksRunner.fire(e, hookOptions))
+                        .toBe(`hook ${e} is disabled.`);
+                }
             });
         });
 
         describe('module-level hooks (event handlers)', function () {
-            var handler = jasmine.createSpy().and.returnValue(Promise.resolve());
+            let handler;
+
+            beforeEach(() => {
+                handler = jasmine.createSpy('testHandler').and.resolveTo();
+                cordova.on(test_event, handler);
+            });
 
             afterEach(function () {
                 cordova.removeAllListeners(test_event);
-                handler.calls.reset();
             });
 
-            it('Test 016 : should fire handlers using cordova.on', function () {
-                cordova.on(test_event, handler);
-                return hooksRunner.fire(test_event, hookOptions).then(function () {
+            it('Test 016 : should fire handlers that were attached using cordova.on', function () {
+                return hooksRunner.fire(test_event).then(function () {
                     expect(handler).toHaveBeenCalled();
                 });
             });
 
             it('Test 017 : should pass the project root folder as parameter into the module-level handlers', function () {
-                cordova.on(test_event, handler);
-                return hooksRunner.fire(test_event, hookOptions).then(function () {
-                    expect(handler).toHaveBeenCalledWith(hookOptions);
+                return hooksRunner.fire(test_event).then(function () {
+                    expect(handler).toHaveBeenCalledWith(jasmine.objectContaining({
+                        projectRoot: project
+                    }));
                 });
             });
 
             it('Test 018 : should be able to stop listening to events using cordova.off', function () {
-                cordova.on(test_event, handler);
                 cordova.off(test_event, handler);
-                return hooksRunner.fire(test_event, hookOptions).then(function () {
+                return hooksRunner.fire(test_event).then(function () {
                     expect(handler).not.toHaveBeenCalled();
                 });
             });
 
-            it('Test 019 : should execute event listeners serially', function () {
+            it('Test 019 : should execute async event listeners serially', function () {
                 const order = [];
                 // Delay 100 ms here to check that h2 is not executed until after
                 // the promise returned by h1 is resolved.
@@ -343,45 +317,15 @@ describe('HooksRunner', function () {
                 cordova.on(test_event, h1);
                 cordova.on(test_event, h2);
 
-                return hooksRunner.fire(test_event, hookOptions)
+                return hooksRunner.fire(test_event)
                     .then(_ => expect(order).toEqual([1, 2]));
             });
 
-            it('Test 021 : should pass data object that fire calls into async handlers', function () {
-                var asyncHandler = function (opts) {
-                    expect(opts).toEqual(hookOptions);
-                    return Promise.resolve();
-                };
-                cordova.on(test_event, asyncHandler);
-                return hooksRunner.fire(test_event, hookOptions);
+            it('Test 021 : should pass options passed to fire into handlers', async () => {
+                const hookOptions = { test: 'funky' };
+                await hooksRunner.fire(test_event, hookOptions);
+                expect(handler).toHaveBeenCalledWith(hookOptions);
             });
-
-            it('Test 022 : should pass data object that fire calls into sync handlers', function () {
-                var syncHandler = function (opts) {
-                    expect(opts).toEqual(hookOptions);
-                };
-                cordova.on(test_event, syncHandler);
-                return hooksRunner.fire(test_event, hookOptions);
-            });
-
-            it('Test 023 : should error if any hook fails', function () {
-                const FAIL_HOOK = `
-                    <widget xmlns="http://www.w3.org/ns/widgets">
-                        <hook type="fail" src="scripts/fail.js" />
-                    </widget>
-                `;
-                addHooksToConfig(FAIL_HOOK);
-
-                return hooksRunner.fire('fail', hookOptions).then(function () {
-                    fail('Expected promise to be rejected');
-                }, function (err) {
-                    expect(err).toEqual(jasmine.any(Error));
-                });
-            });
-        });
-
-        it('Test 024 : should not error if the hook is unrecognized', function () {
-            return hooksRunner.fire('CLEAN YOUR SHORTS GODDAMNIT LIKE A BIG BOY!', hookOptions);
         });
     });
 });
diff --git a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/android/androidBeforeInstall.js b/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/android/androidBeforeInstall.js
deleted file mode 100644
index fbfb513..0000000
--- a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/android/androidBeforeInstall.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('25', context);
-};
diff --git a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall.bat b/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall.bat
deleted file mode 100644
index 7e6b0df..0000000
--- a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-@echo off
-echo 19 >> hooks_order.txt
\ No newline at end of file
diff --git a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall.sh b/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall.sh
deleted file mode 100755
index 2688501..0000000
--- a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall.sh
+++ /dev/null
@@ -1 +0,0 @@
-echo 19 >> hooks_order.txt
\ No newline at end of file
diff --git a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall01.js b/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall01.js
deleted file mode 100644
index 18dcc35..0000000
--- a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall01.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('17', context);
-};
diff --git a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall2.js b/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall2.js
deleted file mode 100644
index 43fdbb2..0000000
--- a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeInstall2.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('18', context);
-};
diff --git a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeUninstall.js b/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeUninstall.js
deleted file mode 100644
index f6e5090..0000000
--- a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/beforeUninstall.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('20', context);
-};
diff --git a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/windows/windowsBeforeInstall.js b/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/windows/windowsBeforeInstall.js
deleted file mode 100644
index 2a370f3..0000000
--- a/spec/cordova/fixtures/plugins/com.plugin.withhooks/scripts/windows/windowsBeforeInstall.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('23', context);
-};
diff --git a/spec/cordova/fixtures/projWithHooks/config.xml b/spec/cordova/fixtures/projWithHooks/config.xml
deleted file mode 100644
index bc81273..0000000
--- a/spec/cordova/fixtures/projWithHooks/config.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
-    <name>HelloCordova</name>
-    <description>
-        A sample Apache Cordova application that responds to the deviceready event.
-    </description>
-    <author email="dev@cordova.apache.org" href="http://cordova.io">
-        Apache Cordova Team
-    </author>
-    <content src="index.html" />
-    <access origin="*" />
-</widget>
\ No newline at end of file
diff --git a/spec/cordova/fixtures/projWithHooks/merges/.gitignore b/spec/cordova/fixtures/projWithHooks/merges/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/spec/cordova/fixtures/projWithHooks/plugins/.gitignore b/spec/cordova/fixtures/projWithHooks/plugins/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforePluginInstall.js b/spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforePluginInstall.js
deleted file mode 100644
index 6b2427f..0000000
--- a/spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforePluginInstall.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('16', context);
-};
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/appBeforePluginInstall.js b/spec/cordova/fixtures/projWithHooks/scripts/appBeforePluginInstall.js
deleted file mode 100644
index 73bb61a..0000000
--- a/spec/cordova/fixtures/projWithHooks/scripts/appBeforePluginInstall.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('10', context);
-};
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforePluginInstall.js b/spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforePluginInstall.js
deleted file mode 100644
index fa4a9d7..0000000
--- a/spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforePluginInstall.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = function(context) {
-    var orderLogger = require(require('path').join(context.opts.projectRoot, 'scripts', 'orderLogger'));
-    orderLogger.logOrder('13', context);
-};
diff --git a/spec/cordova/fixtures/projWithHooks/www/config.xml b/spec/cordova/fixtures/projWithHooks/www/config.xml
deleted file mode 100644
index 9e7b9e0..0000000
--- a/spec/cordova/fixtures/projWithHooks/www/config.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<widget id="org.testing" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
-    <name>TestBase</name>
-    <description>
-        A sample Apache Cordova application that responds to the deviceready event.
-    </description>
-    <author email="dev@cordova.apache.org" href="http://cordova.io">
-        Apache Cordova Team
-    </author>
-    <content src="index.html" />
-    <access origin="*" />
-    <preference name="fullscreen" value="true" />
-    <preference name="webviewbounce" value="true" />
-</widget>
diff --git a/spec/cordova/fixtures/projWithHooks/www/css/index.css b/spec/cordova/fixtures/projWithHooks/www/css/index.css
deleted file mode 100644
index 51daa79..0000000
--- a/spec/cordova/fixtures/projWithHooks/www/css/index.css
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-* {
-    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
-}
-
-body {
-    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
-    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
-    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
-    background-color:#E4E4E4;
-    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
-    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
-    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
-    background-image:-webkit-gradient(
-        linear,
-        left top,
-        left bottom,
-        color-stop(0, #A7A7A7),
-        color-stop(0.51, #E4E4E4)
-    );
-    background-attachment:fixed;
-    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
-    font-size:12px;
-    height:100%;
-    margin:0px;
-    padding:0px;
-    text-transform:uppercase;
-    width:100%;
-}
-
-/* Portrait layout (default) */
-.app {
-    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
-    position:absolute;             /* position in the center of the screen */
-    left:50%;
-    top:50%;
-    height:50px;                   /* text area height */
-    width:225px;                   /* text area width */
-    text-align:center;
-    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with text) */
-    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area height */
-                                   /* offset horizontal: half of text area width */
-}
-
-/* Landscape layout (with min-width) */
-@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
-    .app {
-        background-position:left center;
-        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image height */
-        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
-                                      /* offset horizontal: half of image width and text area width */
-    }
-}
-
-h1 {
-    font-size:24px;
-    font-weight:normal;
-    margin:0px;
-    overflow:visible;
-    padding:0px;
-    text-align:center;
-}
-
-.event {
-    border-radius:4px;
-    -webkit-border-radius:4px;
-    color:#FFFFFF;
-    font-size:12px;
-    margin:0px 30px;
-    padding:2px 0px;
-}
-
-.event.listening {
-    background-color:#333333;
-    display:block;
-}
-
-.event.received {
-    background-color:#4B946A;
-    display:none;
-}
-
-@keyframes fade {
-    from { opacity: 1.0; }
-    50% { opacity: 0.4; }
-    to { opacity: 1.0; }
-}
- 
-@-webkit-keyframes fade {
-    from { opacity: 1.0; }
-    50% { opacity: 0.4; }
-    to { opacity: 1.0; }
-}
- 
-.blink {
-    animation:fade 3000ms infinite;
-    -webkit-animation:fade 3000ms infinite;
-}
diff --git a/spec/cordova/fixtures/projWithHooks/www/img/logo.png b/spec/cordova/fixtures/projWithHooks/www/img/logo.png
deleted file mode 100644
index 9519e7d..0000000
Binary files a/spec/cordova/fixtures/projWithHooks/www/img/logo.png and /dev/null differ
diff --git a/spec/cordova/fixtures/projWithHooks/www/index.html b/spec/cordova/fixtures/projWithHooks/www/index.html
deleted file mode 100644
index bde5741..0000000
--- a/spec/cordova/fixtures/projWithHooks/www/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-     KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<html>
-    <head>
-        <meta charset="utf-8" />
-        <meta name="format-detection" content="telephone=no" />
-        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
-        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
-        <link rel="stylesheet" type="text/css" href="css/index.css" />
-        <title>Hello World</title>
-    </head>
-    <body>
-        <div class="app">
-            <h1>Apache Cordova</h1>
-            <div id="deviceready" class="blink">
-                <p class="event listening">Connecting to Device</p>
-                <p class="event received">Device is Ready</p>
-            </div>
-        </div>
-        <script type="text/javascript" src="cordova.js"></script>
-        <script type="text/javascript" src="js/index.js"></script>
-        <script type="text/javascript">
-            app.initialize();
-        </script>
-    </body>
-</html>
diff --git a/spec/cordova/fixtures/projWithHooks/www/js/index.js b/spec/cordova/fixtures/projWithHooks/www/js/index.js
deleted file mode 100644
index 8d899e3..0000000
--- a/spec/cordova/fixtures/projWithHooks/www/js/index.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-var app = {
-    // Application Constructor
-    initialize: function() {
-        this.bindEvents();
-    },
-    // Bind Event Listeners
-    //
-    // Bind any events that are required on startup. Common events are:
-    // 'load', 'deviceready', 'offline', and 'online'.
-    bindEvents: function() {
-        document.addEventListener('deviceready', this.onDeviceReady, false);
-    },
-    // deviceready Event Handler
-    //
-    // The scope of 'this' is the event. In order to call the 'receivedEvent'
-    // function, we must explicity call 'app.receivedEvent(...);'
-    onDeviceReady: function() {
-        app.receivedEvent('deviceready');
-    },
-    // Update DOM on a Received Event
-    receivedEvent: function(id) {
-        var parentElement = document.getElementById(id);
-        var listeningElement = parentElement.querySelector('.listening');
-        var receivedElement = parentElement.querySelector('.received');
-
-        listeningElement.setAttribute('style', 'display:none;');
-        receivedElement.setAttribute('style', 'display:block;');
-
-        console.log('Received Event: ' + id);
-    }
-};
diff --git a/spec/cordova/fixtures/projWithHooks/www/spec.html b/spec/cordova/fixtures/projWithHooks/www/spec.html
deleted file mode 100644
index 71f00de..0000000
--- a/spec/cordova/fixtures/projWithHooks/www/spec.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE html>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-     KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<html>
-    <head>
-        <title>Jasmine Spec Runner</title>
-
-        <!-- jasmine source -->
-        <link rel="shortcut icon" type="image/png" href="spec/lib/jasmine-1.2.0/jasmine_favicon.png">
-        <link rel="stylesheet" type="text/css" href="spec/lib/jasmine-1.2.0/jasmine.css">
-        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine.js"></script>
-        <script type="text/javascript" src="spec/lib/jasmine-1.2.0/jasmine-html.js"></script>
-
-        <!-- include source files here... -->
-        <script type="text/javascript" src="js/index.js"></script>
-
-        <!-- include spec files here... -->
-        <script type="text/javascript" src="spec/helper.js"></script>
-        <script type="text/javascript" src="spec/index.js"></script>
-
-        <script type="text/javascript">
-            (function() {
-                var jasmineEnv = jasmine.getEnv();
-                jasmineEnv.updateInterval = 1000;
-
-                var htmlReporter = new jasmine.HtmlReporter();
-
-                jasmineEnv.addReporter(htmlReporter);
-
-                jasmineEnv.specFilter = function(spec) {
-                    return htmlReporter.specFilter(spec);
-                };
-
-                var currentWindowOnload = window.onload;
-
-                window.onload = function() {
-                    if (currentWindowOnload) {
-                        currentWindowOnload();
-                    }
-                    execJasmine();
-                };
-
-                function execJasmine() {
-                    jasmineEnv.execute();
-                }
-            })();
-        </script>
-    </head>
-    <body>
-        <div id="stage" style="display:none;"></div>
-    </body>
-</html>
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforeBuild.bat b/spec/cordova/fixtures/projectHooks/android/appAndroidBeforeBuild.bat
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforeBuild.bat
rename to spec/cordova/fixtures/projectHooks/android/appAndroidBeforeBuild.bat
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforeBuild.js b/spec/cordova/fixtures/projectHooks/android/appAndroidBeforeBuild.js
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforeBuild.js
rename to spec/cordova/fixtures/projectHooks/android/appAndroidBeforeBuild.js
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforeBuild.sh b/spec/cordova/fixtures/projectHooks/android/appAndroidBeforeBuild.sh
old mode 100644
new mode 100755
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/android/appAndroidBeforeBuild.sh
rename to spec/cordova/fixtures/projectHooks/android/appAndroidBeforeBuild.sh
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/appBeforeBuild02.js b/spec/cordova/fixtures/projectHooks/appBeforeBuild02.js
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/appBeforeBuild02.js
rename to spec/cordova/fixtures/projectHooks/appBeforeBuild02.js
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/appBeforeBuild1.bat b/spec/cordova/fixtures/projectHooks/appBeforeBuild1.bat
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/appBeforeBuild1.bat
rename to spec/cordova/fixtures/projectHooks/appBeforeBuild1.bat
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/appBeforeBuild1.sh b/spec/cordova/fixtures/projectHooks/appBeforeBuild1.sh
old mode 100644
new mode 100755
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/appBeforeBuild1.sh
rename to spec/cordova/fixtures/projectHooks/appBeforeBuild1.sh
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/fail.js b/spec/cordova/fixtures/projectHooks/fail.js
similarity index 94%
rename from spec/cordova/fixtures/projWithHooks/scripts/fail.js
rename to spec/cordova/fixtures/projectHooks/fail.js
index d6f2c02..076222b 100644
--- a/spec/cordova/fixtures/projWithHooks/scripts/fail.js
+++ b/spec/cordova/fixtures/projectHooks/fail.js
@@ -1,3 +1,3 @@
 module.exports = () => {
     throw new Error();
-};
\ No newline at end of file
+};
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/orderLogger.js b/spec/cordova/fixtures/projectHooks/orderLogger.js
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/orderLogger.js
rename to spec/cordova/fixtures/projectHooks/orderLogger.js
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforeBuild.bat b/spec/cordova/fixtures/projectHooks/windows/appWindowsBeforeBuild.bat
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforeBuild.bat
rename to spec/cordova/fixtures/projectHooks/windows/appWindowsBeforeBuild.bat
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforeBuild.js b/spec/cordova/fixtures/projectHooks/windows/appWindowsBeforeBuild.js
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforeBuild.js
rename to spec/cordova/fixtures/projectHooks/windows/appWindowsBeforeBuild.js
diff --git a/spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforeBuild.sh b/spec/cordova/fixtures/projectHooks/windows/appWindowsBeforeBuild.sh
old mode 100644
new mode 100755
similarity index 100%
rename from spec/cordova/fixtures/projWithHooks/scripts/windows/appWindowsBeforeBuild.sh
rename to spec/cordova/fixtures/projectHooks/windows/appWindowsBeforeBuild.sh


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