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