小编Lim*_*nis的帖子

mocha,chai,Uncaught AssertionError:期望{}等于{} +期望 - 实际

  it('GET /customers/ with wrong id', (done) => {
    request
      .get(`/customers/${wrongId}`)
      .end((err, res) => {
        expect(res.body).to.equals({});
        expect(res).to.have.status(404);
        done();
      });
  });
Run Code Online (Sandbox Code Playgroud)

1)客户CRUD GET /客户/ ID错误:

  Uncaught AssertionError: expected {} to equal {}
  + expected - actual
Run Code Online (Sandbox Code Playgroud)

mocha.js chai

11
推荐指数
1
解决办法
2万
查看次数

当我们有多对多关系时,如何在 firebase 中获取数据

我阅读了 Firebase 中的多对多关系问题,
这里描述了如何在 firebase(nosql 数据库)中创建或构建多对多关系,这很容易,

companyContractors
  companyKey1
    contractorKey1: true
    contractorKey3: true
  companyKey2
    contractorKey2: true
contractorCompanies
  contractorKey1
    companyKey1: true,
    companyKey2: true
  contractorKey2
    companyKey2: true
  contractorKey3
    companyKey1: true
Run Code Online (Sandbox Code Playgroud)

但是当我想获得所有承包商的特定公司时,我可以只使用一个请求吗?因为在这种情况下,我只得到 id 列表,在那里之后,使用 js 循环或 forEach,我做了多个请求。

通常在其他 API 上,我只使用

URL/contractor/:id/company or 
URL/company/:id/contractors 
Run Code Online (Sandbox Code Playgroud)

如何在firebase上做到这一点?
有一个使用angular2,angularfire2的例子会很酷,
谢谢

AskFirebase

javascript nosql firebase firebase-realtime-database angularfire2

5
推荐指数
1
解决办法
1799
查看次数

我可以在我的项目中使用全局 box-sizing:border-box 吗?

我可以在我的所有 murkup (所有项目)中使用吗box-sizing: border-box;

例如:

html { 
   box-sizing: border-box; 
}, 
:before, *:after {
  box-sizing: inherit; 
}
Run Code Online (Sandbox Code Playgroud)

因为计算实际宽度更容易,但是这种方法有什么缺点吗?

html css border-box box-sizing

3
推荐指数
1
解决办法
7181
查看次数