Bones/node_modules/angular2/es6/dev/examples/testing/ts/matchers.js

33 lines
3.5 KiB
JavaScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
import { expect } from 'angular2/testing';
var value;
var element;
var exception;
class OtherClass {
}
class SomeClass {
}
// #docregion toBePromise
expect(value).toBePromise();
// #enddocregion
// #docregion toBeAnInstanceOf
expect(value).toBeAnInstanceOf(SomeClass);
// #enddocregion
// #docregion toHaveText
expect(element).toHaveText('Hello world!');
// #enddocregion
// #docregion toHaveCssClass
expect(element).toHaveCssClass('current');
// #enddocregion
// #docregion toHaveCssStyle
expect(element).toHaveCssStyle({ width: '100px', height: 'auto' });
// #enddocregion
// #docregion toContainError
expect(exception).toContainError('Failed to load');
// #enddocregion
// #docregion toThrowErrorWith
expect(() => { throw 'Failed to load'; }).toThrowErrorWith('Failed to load');
// #enddocregion
// #docregion toImplement
expect(SomeClass).toImplement(OtherClass);
// #enddocregion
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0Y2hlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJhbmd1bGFyMi9leGFtcGxlcy90ZXN0aW5nL3RzL21hdGNoZXJzLnRzIl0sIm5hbWVzIjpbIk90aGVyQ2xhc3MiLCJTb21lQ2xhc3MiXSwibWFwcGluZ3MiOiJPQUFPLEVBQUMsTUFBTSxFQUFDLE1BQU0sa0JBQWtCO0FBRXZDLElBQUksS0FBVSxDQUFDO0FBQ2YsSUFBSSxPQUFZLENBQUM7QUFDakIsSUFBSSxTQUFjLENBQUM7QUFFbkI7QUFBMkJBLENBQUNBO0FBQzVCO0FBQWlCQyxDQUFDQTtBQUVsQix5QkFBeUI7QUFDekIsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBQzVCLGdCQUFnQjtBQUVoQiw4QkFBOEI7QUFDOUIsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDLGdCQUFnQixDQUF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