babel-polyfill未针对聚合物1测试套件加载

时间:2018-07-23 22:11:54

标签: javascript polymer polymer-1.0 wct

聚合物1.通过npm导入babel-polyfill,然后通过

导入root index.html
<script src="/node_modules/babel-polyfill/dist/polyfill.min.js" async></script>

在我的test/index.html文件中,我遇到的问题是:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">

    <title>Tests</title>
    <script src="../node_modules/babel-polyfill/dist/polyfill.min.js"></script>
    <script src="../bower_components/web-component-tester/browser.js"></script>
  </head>
  <body>
    <script>
      WCT.loadSuites([
        'all_my_tests.html'
      ]);
    </script>
  </body>
</html>

```

```

<script src="../node_modules/babel-polyfill/dist/polyfill.min.js"></script> <script src="../bower_components/web-component-tester/browser.js"></script>

仍然导致以下结果:

Windows 8.1 IE 11 Tests failed: Error thrown outside of test function: the string "console.error: Error stamping [object HTMLUnknownElement] ReferenceError: 'Promise' is undefined" was thrown, throw an Error :)

由于某种原因,我认为此polyfill在运行测试套件之前未导入。我是否应该将其添加到wct.config.json的某个位置或以某种特定方式导入,以确保已为执行测试实际加载了它?

0 个答案:

没有答案