我正在为angular2服务编写单元测试.代码片段:
// jasmine specfile
// already injected MockConnection into Http
backend.connections.subscribe ((c: MockConnection) => {
connection = c;
});
// doing get-request
myServiceCallwithHttpRequest ().subscribe (result => {
// this test passes!
expect (result).toEqual ({
"message": "No Such Object"
});
// this test fails, don't know how to get the response code
expect (whereIsResponseStatus).toBe (404);
});
connection.mockRespond (new Response (new ResponseOptions ({
body: {
"message": "No Such Object"
},
status: 404
})));
Run Code Online (Sandbox Code Playgroud)
我的服务:
// service
myServiceCallwithHttpRequest (): Observable<Response> {
return this.http.get …Run Code Online (Sandbox Code Playgroud) 我试图使用启动脚本连接到我的Azure Mobile服务的扩展文件夹中托管的Socket.IO服务器,虽然我无法这样做,并收到错误:
"WebSocket connection to 'ws://mymobileservice.azure-mobile.net/extensions/socket.io/?EIO=2&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 503"
我使用端口80的路径为'extensions/socket.io'我还使用了端口443与安全连接,并产生了相同的错误.
我是在正确的轨道上吗?任何帮助是极大的赞赏.
在 Firefox 上使用 NVDA 时,从容器聚焦时无法读取第一个孩子,但可以读取第二个孩子。
通用示例:
<div class="container" tabindex="0">
<div class="child" aria-label="Child 1" tabindex="0">Child 1</div>
<div class="child" aria-label="Child 2" tabindex="0">Child 2</div>
</div>
Run Code Online (Sandbox Code Playgroud)
当.container聚焦时,您按 Tab 键聚焦“Child 1”,NVDA 不会读取“Child 1”,而是保持沉默。如果您再次点击 Tab,NVDA 会显示“Child 2”。
这在带有 ChromeVox 插件的 Chrome 上读取正确。
这是一个代码笔:http ://codepen.io/anon/pen/WGyxom
是否缺少某些配置以允许 NVDA 在聚焦时读取“Child 1” .container?
我有一个 VSTS Release Definition,它传递了两个变量,我无法控制其中的内容。它们包含一个逗号分隔的名称字符串和一个逗号分隔的 ID 字符串,它们与按索引的名称相对应。
我想使用一个代理阶段,将并行选项设置为多配置,并将乘数字段设置为 ID 字符串,因此该阶段为每个 ID 运行一次。我还想使用与该阶段中的 ID 对应的名称,但我不确定如何执行此操作。
如果我将乘数设置为两个变量(ID 和名称),它会运行两个数组的笛卡尔积(交叉连接)的阶段,这是不需要的。
例子:
IDs: "A1, A2, A3"
Names: "Anna, Adam, Abby"
Runs the phase 9 times: "A1" & "Anna", "A2" & "Anna", "A3" & "Anna"
"A1" & "Adam", "A2" & "Adam", "A3" & "Adam"
"A1" & "Abby", "A2" & "Abby", "A3" & "Abby"
Run Code Online (Sandbox Code Playgroud)
如果我将乘数设置为 ID 变量,它只会运行阶段正确的次数,但我无法弄清楚如何将相应的名称传递到阶段。
这甚至可能吗?
提前致谢!
angular ×1
azure ×1
azure-devops ×1
azure-pipelines-release-pipeline ×1
firefox ×1
html ×1
node.js ×1
nvda ×1
socket.io ×1
typescript ×1
unit-testing ×1
websocket ×1