How can I use wallabyjs to run my tests on Polymer 2.0

56 Views Asked by At

There is a example using Polymer 1.x on wallaby-polymer-sample but it doesn't work with Polymer 2.0.

This is my wallaby.js file:

module.exports = function (wallaby) {
  return {
    files: [
      {pattern: 'bower_components/webcomponentsjs/webcomponents-lite.js', instrument: false},
      {pattern: 'src/*.html', load: false},
    ],

    tests: [
      'test/*-test.js',
      'test/*.html',
    ],

    env: {
      kind: 'electron'
    },

    middleware: function (app, express) {
      app.use('/polymer', express.static(
        require('path').join(__dirname, 'bower_components', 'polymer')
      ))
    },

    setup: function (wallaby) {
      if (!window.CustomElements || !window.CustomElements.readyTime) {
        wallaby.delayStart();
        window.addEventListener('WebComponentsReady', function () {
          wallaby.start();
        });
      }
    }
  }
}

I'm getting this error:

Uncaught ReferenceError: Polymer is not defined
0

There are 0 best solutions below