angular-cn/packages/core/test/dom/shim_spec.ts

28 lines
693 B
TypeScript
Raw Normal View History

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
{
describe('Shim', () => {
it('should provide correct function.name ', () => {
const functionWithoutName = identity(() => function(_: any /** TODO #9100 */) {});
function foo(_: any /** TODO #9100 */) {}
2016-05-01 23:53:26 -04:00
expect((<any>functionWithoutName).name).toBeFalsy();
expect((<any>foo).name).toEqual('foo');
});
});
}
2016-05-01 23:53:26 -04:00
function identity(a: any /** TODO #9100 */) {
2016-05-02 01:50:37 -04:00
return a;
}