@ -6,15 +6,17 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {KeyValueArray, arrayIndexOfSorted, arrayInsert, arrayInsert2, arrayInsertSorted, arrayRemoveSorted, arraySplice, flatten, keyValueArrayDelete, keyValueArrayGet, keyValueArrayIndexOf, keyValueArraySet} from '../../src/util/array_utils';
|
||||
import {arrayIndexOfSorted, arrayInsert, arrayInsert2, arrayInsertSorted, arrayRemoveSorted, arraySplice, flatten, KeyValueArray, keyValueArrayDelete, keyValueArrayGet, keyValueArrayIndexOf, keyValueArraySet} from '../../src/util/array_utils';
|
||||
|
||||
describe('array_utils', () => {
|
||||
|
||||
describe('flatten', () => {
|
||||
it('should flatten an empty array', () => {
|
||||
expect(flatten([])).toEqual([]);
|
||||
});
|
||||
|
||||
it('should flatten an empty array', () => { expect(flatten([])).toEqual([]); });
|
||||
|
||||
it('should flatten a flat array', () => { expect(flatten([1, 2, 3])).toEqual([1, 2, 3]); });
|
||||
it('should flatten a flat array', () => {
|
||||
expect(flatten([1, 2, 3])).toEqual([1, 2, 3]);
|
||||
});
|
||||
|
||||
it('should flatten a nested array depth-first', () => {
|
||||
expect(flatten([1, [2], 3])).toEqual([1, 2, 3]);
|
||||
@ -75,7 +77,6 @@ describe('array_utils', () => {
|
||||
});
|
||||
|
||||
describe('arrayInsertSorted', () => {
|
||||
|
||||
it('should insert items don\'t allow duplicates', () => {
|
||||
let a;
|
||||
a = ['a', 'c', 'e', 'g', 'i'];
|
||||
@ -103,7 +104,6 @@ describe('array_utils', () => {
|
||||
|
||||
|
||||
describe('arrayRemoveSorted', () => {
|
||||
|
||||
it('should remove items', () => {
|
||||
let a;
|
||||
a = ['a', 'b', 'c', 'd', 'e'];
|
||||
|
@ -24,8 +24,7 @@ class DecoratedChild extends DecoratedParent {}
|
||||
const Prop = makePropDecorator('Prop', (value: any) => ({value}));
|
||||
|
||||
class TestClass {
|
||||
@Prop('firefox!')
|
||||
watch: any;
|
||||
@Prop('firefox!') watch: any;
|
||||
}
|
||||
|
||||
const p = reflector.propMetadata(TestClass);
|
||||
|
@ -19,7 +19,9 @@ declare var globalThis: any /** TODO #9100 */;
|
||||
});
|
||||
|
||||
if (typeof globalThis !== 'undefined') {
|
||||
it('should use globalThis as global reference', () => { expect(global).toBe(globalThis); });
|
||||
it('should use globalThis as global reference', () => {
|
||||
expect(global).toBe(globalThis);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {isObservable, isPromise} from '@angular/core/src/util/lang';
|
||||
import {of } from 'rxjs';
|
||||
import {of} from 'rxjs';
|
||||
|
||||
{
|
||||
describe('isPromise', () => {
|
||||
@ -28,7 +28,7 @@ import {of } from 'rxjs';
|
||||
});
|
||||
|
||||
describe('isObservable', () => {
|
||||
it('should be true for an Observable', () => expect(isObservable(of (true))).toEqual(true));
|
||||
it('should be true for an Observable', () => expect(isObservable(of(true))).toEqual(true));
|
||||
|
||||
it('should be true if the argument is the object with subscribe function',
|
||||
() => expect(isObservable({subscribe: () => {}})).toEqual(true));
|
||||
|
@ -21,7 +21,8 @@ describe('stringify', () => {
|
||||
expect(concatStringsWithSpace('', 'b')).toEqual('b');
|
||||
});
|
||||
|
||||
it('should concat when not empty',
|
||||
() => { expect(concatStringsWithSpace('before', 'after')).toEqual('before after'); });
|
||||
it('should concat when not empty', () => {
|
||||
expect(concatStringsWithSpace('before', 'after')).toEqual('before after');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user