如何使用wallabyjs在Polymer 2.0上运行我的测试

时间:2017-05-24 11:52:27

标签: polymer-2.x wallaby.js

有一个例子在wallaby-polymer-sample上使用Polymer 1.x,但它不适用于Polymer 2.0。

这是我的$ VAR="KEY1=value1 KEY2=value" $ env $VAR bash -c 'declare -p ${!KEY*}' declare -x KEY1="value1" declare -x KEY2="value" 文件:

wallaby.js

我收到此错误:

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();
        });
      }
    }
  }
}

0 个答案:

没有答案