it('should store the passed-in location', () => { const bindings = parseTemplateBindings('a 1,b 2', 'location'); expect(bindings[0].expression.location).toEqual('location'); });
it('calling discardPeriodicTasks should throw', () => { expect(() => { discardPeriodicTasks(); }).toThrowError('The code should be running in the fakeAsync zone to call this function'); });
it('should use the same zone as in beforeEach', fakeAsync(() => { zoneInTest1 = Zone.current; expect(zoneInTest1).toBe(zoneInBeforeEach); }));
it('should throw an error on dangling periodic timers', () => { expect(() => { fakeAsync(() => { setInterval(() => {}, 10); })(); }).toThrowError('1 periodic timer(s) still in the queue.'); });
fakeAsync((foo: any /** TODO #9100 */, bar: any /** TODO #9100 */) => { expect(foo).toEqual('foo'); expect(bar).toEqual('bar'); })('foo', 'bar');
it('should use the document head as default host', () => { ssh.addStyles(['a {};', 'b {};']); expect(doc.head).toHaveText('a {};b {};'); });
it('should complain if a test throws an exception', () => { expect(() => { fakeAsync(() => { throw new Error('sync'); })(); }).toThrowError('sync'); });
it('should parse prefix/suffix with multiple interpolation', () => { const originalExp = 'before {{ a }} middle {{ b }} after'; const ast = parseInterpolation(originalExp).ast; expect(unparse(ast)).toEqual(originalExp); validate(ast); });
it('should parse a field access', () => { const p = parseSimpleBinding('name'); expect(unparse(p)).toEqual('name'); validate(p); });
() => { expect(parseInterpolation('nothing')).toBe(null); });