现在的位置: 首页 > 综合 > 正文

jasmine: Don’t make DOM manipulation outside ‘beforeEach’ and ‘it’

2011年04月06日 ⁄ 综合 ⁄ 共 394字 ⁄ 字号 评论关闭

jasmine will create Suite before loading the report html. You code like:
[javascript]
var canvasDiv;
canvasDiv = new Element('div', {'id': 'canvas'});
canvasDiv.update('hello world');
// the following makes the trouble
$(document.body).insert(canvasDiv);
[/javascript]
will fail the creation of jasmine.Suite. And you will get a error like:
[html]
jasmine.Suite() required
http://localhost:8888/__JASMINE_ROOT__/lib/jasmine.js Line 1856
[/html]

抱歉!评论已关闭.