1/* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20import chai from 'chai'; 21import { 22 before, 23 describe, 24 it 25} from 'mocha'; 26import { 27 fakeLog, 28 fakeLogRestore 29} from '../../fakeLog'; 30import { App } from '../../../runtime/main/app/App'; 31 32const expect = chai.expect; 33 34describe('App Instance', () => { 35 fakeLog(); 36 37 let app: App; 38 let appInstanceId: string; 39 40 before(() => { 41 const appInstanceId = Date.now() + ''; 42 app = new App('test', appInstanceId); 43 }); 44 45 describe('normal check', () => { 46 it('is a class', () => { 47 expect(typeof App).eql('function'); 48 }); 49 50 it('being created', () => { 51 expect(app).to.be.an('object'); 52 expect(app).to.be.instanceof(App); 53 }); 54 55 it('with some apis', () => { 56 expect(typeof app.deleteGlobalKeys).eql('function'); 57 }); 58 59 it('run apis', () => { 60 expect(app.deleteGlobalKeys()).to.be.undefined; 61 }); 62 }); 63 64 fakeLogRestore(); 65});