我已经设置了一个简单的规范:
describe("A suite", function() {
it("contains spec with an expectation", function() {
expect(true).toBe(true);
});
});
当我跑步时,grunt jasmine
我得到:
Running "jasmine:src" (jasmine) task
Testing jasmine specs via PhantomJS
A suite
× contains spec with an expectation
TypeError: 'undefined' is not a function (evaluating 'expect(true).toBe(tru
e)') in file:///C:/Users/long-path-to-spec/testing-spec.js (line 4) (1)
1 spec in 0s.
>> 1 failures
Warning: Task "jasmine:src" failed. Use --force to continue.
Aborted due to warnings.
它似乎正在运行规范......它似乎知道“描述”和“它”是什么,但它似乎不知道“期望”?
有任何想法吗?