code: function configureAxe (defaultOptions = {}) {
    /**
     * Small wrapper for axe-core#run that enables promises (required for Jest),
     * default options and injects html to be tested
     * @param {string} html requires a html string to be injected into the body
     * @param {object} [additionalOptions] aXe options to merge with default options
     * @returns {promise} returns promise that will resolve with axe-core#run results object
     */
    return function axe (html, additionalOptions = {}) {
      const htmlType = (typeof html)
      if (htmlType !== 'string') {
        throw new Error(`html parameter should be a string not a ${htmlType}`)
      }
  
      const hasHtmlElements = /(<([^>]+)>)/i.test(html)
      if (!hasHtmlElements) {
        throw new Error(`html parameter ("${html}") has no elements`)
      }
  
      // Before we use Jests's jsdom document we store and remove all child nodes from the body.
      const axeContainer = document.createElement('div');
      axeContainer.innerHTML = html
  
      // aXe requires real Nodes so we need to inject into Jests' jsdom document.
      document.body.appendChild(axeContainer)
  
      const options = merge({}, defaultOptions, additionalOptions)
  
      return new Promise((resolve, reject) => {
        axeCore.run(axeContainer, options, (err, results) => {
          // In any case we restore the contents of the body by removing the additional element again.
          document.body.removeChild(axeContainer)
  
          if (err) throw err
          resolve(results)
        })
      })
    }
  }
docs: Small wrapper for axe-core#run that enables promises (required for Jest),
  default options and injects html to be tested
  @param {object} [defaultOptions] default options to use in all instances
  @returns {function} returns instance of axe