spec/plugin-api.spec.js
function mockPlugin(name, deferInit = false) {
        class MockPlugin {
            constructor(params, ws) {
                this.ws = ws;
                // using the instance factory unfortunately makes it
                // difficult to use the spyOn function, so we use this
                // instead
                this.isInitialised = false;
            }
            init() {
                this.isInitialised = true;
            }
            destroy() {}
        }
        return {
            name,
            deferInit,
            staticProps: {
                [`${name}Static`]: 'static property value'
            },
            instance: MockPlugin
        };
    }
function mockPlugin(name, deferInit = false) {
        class MockPlugin {
            constructor(params, ws) {
                this.ws = ws;
                // using the instance factory unfortunately makes it
                // difficult to use the spyOn function, so we use this
                // instead
                this.isInitialised = false;
            }
            init() {
                this.isInitialised = true;
            }
            destroy() {}
        }
        return {
            name,
            deferInit,
            staticProps: {
                [`${name}Static`]: 'static property value'
            },
            instance: MockPlugin
        };
    }
function mockPlugin ( name , deferInit = false ) { class MockPlugin { constructor ( params , ws ) { this . ws = ws ; // using the instance factory unfortunately makes it // difficult to use the spyOn function, so we use this // instead this . isInitialised = false ; } init ( ) { this . isInitialised = true ; } destroy ( ) { } } return { name , deferInit , staticProps : { [ ` ${ name } ` ] : 'static property value' } , instance : MockPlugin } ; }
utility function to generate a mock plugin object
utility function to generate a mock plugin object