code: 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
          };
      }
docs: utility function to generate a mock plugin object