知道两个测试之间有什么区别(或者为什么第一个测试不起作用?)
expect([{ id: 1 }]).to.deep.include.members([{ id: 1 }]);
给出错误:
TypeError: expect(...).to.deep is undefined
但这有效:
expect([{ id: 1 }]).to.eql([{ id: 1 }]);
我正在使用浏览器的版本,包括:
<script src="https://cdn.rawgit.com/jquery/jquery/2.1.4/dist/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/Automattic/expect.js/0.3.1/index.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/3.5.0/chai.min.js"></script>
<script src="https://cdn.rawgit.com/mochajs/mocha/2.2.5/mocha.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/superagent/2.3.0/superagent.min.js"></script>