gpt4 book ai didi

polymer - Firefox 的 Web Component Tester 中的所有测试均失败

转载 作者:行者123 更新时间:2023-12-02 01:35:49 25 4
gpt4 key购买 nike

在创建 Polymer Starter Kit 的干净副本后,使用 Web 组件测试器(“测试”Gulp 任务)运行测试会导致所有测试在 Firefox 中失败。

测试在 Chrome 和 IE 中运行良好。

错误是:

firefox 39               ✖ my-greeting-basic.html
Timed out loading http://localhost:2000/components/polymer-starter/my-greeting-basic.html?
<unknown> at done at /components/mocha/mocha.js:1846:0
<unknown> at Runner.prototype.run/< at /components/mocha/mocha.js:5213:0
<unknown> at EventEmitter.prototype.emit at /components/mocha/mocha.js:616:0
<unknown> at start/< at /components/mocha/mocha.js:5203:0
<unknown> at Runner.prototype.runSuite at /components/mocha/mocha.js:5103:0
<unknown> at start at /components/mocha/mocha.js:5201:0
<unknown> at Runner.prototype.run at /components/mocha/mocha.js:5226:0
<unknown> at Mocha.prototype.run at /components/mocha/mocha.js:1849:0
<unknown> at g at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at w at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at f at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
<unknown> at p at /bower_components/webcomponentsjs/webcomponents.min.js:11:0
404 GET /components/polymer-starter/my-list-basic.html
firefox 39 ✖ my-list-basic.html
Timed out loading http://localhost:2000/components/polymer-starter/my-list-basic.html?
firefox 39 Tests failed: 2 failed tests
Test run ended in failure: 2 failed tests
Process terminated with code 1.

在浏览器中,对测试套件的调用导致 404。

最佳答案

问题是 Windows 中的 Firefox 在看到路径中的反斜杠时搞砸了。我花了很长时间才弄明白,但我已经在相关项目上开了一张票,并提交了一个拉取请求以解决我想出的问题。

如果您不耐烦,可以导航至 <your project>/node_modules/web_component_tester/runner/webserver.js并将以下内容放在第 80 行之前(options.webserver.webRunnerContent = INDEX_TEMPLATE(options))

options.suites = options.suites.map(function (cv) {
return cv.replace(/\\/g,'/');
})

这会将路径中的反斜杠更改为 Firefox 没有问题的正斜杠。

关于polymer - Firefox 的 Web Component Tester 中的所有测试均失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31287254/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com