1

我想做一个简单的规范,涉及 phantomJS 正在工作的 DOM 操作:

/*global describe it */
'use strict';
(function () {
    describe('DOM Tests', function () {
        var strong = 'Viva!';
        var text = document.getElementById('test').innerHTML;

        console.log(text);
        it("is in DOM", function(){
            expect(strong).equal('Viva!');
        });
    });
})();

但是跑完之后grunt test

没有断言

Running "clean:server" (clean) task
Cleaning ".tmp"...OK

Running "haml:app" (haml) task

Running "coffee:dist" (coffee) task
File .tmp/scripts/app.js created.

Running "coffee:test" (coffee) task

Running "compass:dist" (compass) task
directory .tmp/styles/ 
   create .tmp/styles/main.css 

Running "compass:server" (compass) task
unchanged app/styles/main.scss

Running "connect:test" (connect) task
Starting connect web server on localhost:9000.

Running "mocha:all" (mocha) task
Testing index.htmlOK
>> 0 assertions passed (0s)

Done, without errors.

是代码存储库,以防您需要检查我的代码

4

0 回答 0