聚合物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
的某个位置或以某种特定方式导入,以确保已为执行测试实际加载了它?