本文整理汇总了TypeScript中angular2/test_lib.expect函数的典型用法代码示例。如果您正苦于以下问题:TypeScript expect函数的具体用法?TypeScript expect怎么用?TypeScript expect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了expect函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
ObservableWrapper.subscribe(a.valueChanges, (value) => {
expect(value).toEqual(['old1', 'old2']);
async.done();
});
示例2: inject
inject([StyleInliner], (inliner) => {
var css = '.main {}';
var loadedCss = inliner.inlineImports(css, 'http://base');
expect(loadedCss).toEqual(css);
}));
示例3: function
function(css) {
expect(css).toEqual('.one {}\n.two {}\n.main {}');
async.done();
},
示例4: expect
() => { expect(fakeAsync(() => 'foo')()).toEqual('foo'); });
示例5: it
it('calling tick should throw', () => {
expect(() => { tick(); })
.toThrowError('The code should be running in the fakeAsync zone to call this function');
});
示例6: inject
inject([Parser], fakeAsync((parser) => { expect(parser).toBeAnInstanceOf(Parser); })));
示例7: it
it("should not update the parent when explicitly specified", () => {
c.updateValue("newValue", {onlySelf: true});
expect(g.value).toEqual({"one": "oldValue"});
});