0
を結果aparently等しい値を持つアサーション私はこのJavaScriptコードを持っている:Javascriptを:異なる
const BaseList = {
new: function(list) {
this.list = list;
return this;
},
sortKeys: function(key) {
const keys = Object.keys(this.list);
keys.push(key);
keys.sort();
return keys;
}
}
module.exports = BaseList;
と私はモカ/アサートがこれをやってsortKeys
をテストしてい:
describe('#sortKeys', function() {
it('should insert a new key in order', function() {
const par = {'a': 'test_a', 'c': 'test_c'};
const bl = BaseList.new(par);
const sl = bl.sortKeys('b');
assert.equal(sl,['a','b','c']);
});
});
私のテストであることを起こります失敗メッセージが表示されます:
AssertionError [ERR_ASSERTION]: [ 'a', 'b', 'c' ] == [ 'a', 'b', 'c' ]
アサーションはそれらが異なっていると言います。
私はここで何が欠けていますか?
はどうもありがとうございました! –