jasmine: Don't make DOM manipulation outside 'beforeEach' and 'it'
Posted on 2011-02-16 17:41 勇敢的鸵鸟 阅读(186) 评论(0) 编辑 收藏 举报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]