预期的jQuery({0:HTMLNode,长度:1})是'#container'不起作用?

describe('Name validator',function () { var elem; beforeEach(function () { elem = $('<div id="container"><p>Hello World</p></div>'); }); it("allows us to seaarch with css",function () { expect(elem).toBe('#container'); }); 

});

我重新发布这个问题来获得一些快速的回应。 以上给出的代码是我的testing用例,它给出了错误

 'Expected jQuery({ 0: HTMLNode, length: 1 }) to be '#container' 

这是为什么? 任何解决scheme