1 import {Utils} from "./utils";
2 import {TestBed} from "@angular/core/testing";
3 import each from "jest-each";
6 describe('Util', () => {
9 beforeAll(done => (async () => {
10 TestBed.configureTestingModule({
13 await TestBed.compileComponents();
17 })().then(done).catch(done.fail));
19 test('should be defined', () => {
20 expect(util).toBeDefined();
23 test('hasContents should return false if object is undefined or null or empty', () => {
24 expect(Utils.hasContents(undefined)).toBeFalsy();
25 expect(Utils.hasContents(null)).toBeFalsy();
26 expect(Utils.hasContents("")).toBeFalsy();
29 test('hasContents should return true if object is not undefined and not null and not empty', () => {
30 expect(Utils.hasContents("someValue")).toBeTruthy();
33 const instantiationTypesDataProvider = [
36 ['ClientConfig', true],
39 each(instantiationTypesDataProvider).test('instantiationType %s isALaCarte shall be %s', (instantiationType, expected ) => {
40 expect(Utils.isALaCarte(instantiationType)).toEqual(expected);