7
私はJavascriptには新しく、単体テストを行うためのチャイライブラリーに関して簡単な質問があります。チャイライブラリーでequalとeqlの違いは何ですか
私はChai図書館でいくつかの資料を勉強していましたが、「ターゲットは厳密に(===)valueと等しいと主張する」というステートメントを見ましたが、eqlはターゲットがvalueと深く等しいと主張します。 "
しかし、私はその違いが厳密で深いのか混乱しています。
var myObj = {
testProperty: 'testValue'
};
var anotherReference = myObj;
expect(myObj).to.equal(anotherReference); // The same object, only referenced by another variable
expect(myObj).to.not.equal({testProperty: 'testValue'}); // Even though it has the same property and value, it is not exactly the same object
深く均等一方のあらゆる性を比較することを意味:
[?等しいとの違いは何?EQL?===、および==]の可能な重複(http://stackoverflow.com/questions/7156955/whats-the-difference- between-equal-eql-and) – 8protons