1e484b35bSopenharmony_ci/* 2e484b35bSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3e484b35bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e484b35bSopenharmony_ci * you may not use this file except in compliance with the License. 5e484b35bSopenharmony_ci * You may obtain a copy of the License at 6e484b35bSopenharmony_ci * 7e484b35bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e484b35bSopenharmony_ci * 9e484b35bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e484b35bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e484b35bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e484b35bSopenharmony_ci * See the License for the specific language governing permissions and 13e484b35bSopenharmony_ci * limitations under the License. 14e484b35bSopenharmony_ci */ 15e484b35bSopenharmony_ci 16e484b35bSopenharmony_ciimport sinon from 'sinon'; 17e484b35bSopenharmony_ciimport { Log } from '../runtime/utils/utils'; 18e484b35bSopenharmony_ci 19e484b35bSopenharmony_cilet fakeDebug: any; 20e484b35bSopenharmony_cilet fakeInfo: any; 21e484b35bSopenharmony_cilet fakeWarn: any; 22e484b35bSopenharmony_cilet fakeError: any; 23e484b35bSopenharmony_ci 24e484b35bSopenharmony_ciexport function fakeLog() { 25e484b35bSopenharmony_ci fakeDebug = sinon.stub(Log, 'debug').callsFake(); 26e484b35bSopenharmony_ci fakeInfo = sinon.stub(Log, 'info').callsFake(); 27e484b35bSopenharmony_ci fakeWarn = sinon.stub(Log, 'warn').callsFake(); 28e484b35bSopenharmony_ci fakeError = sinon.stub(Log, 'error').callsFake(); 29e484b35bSopenharmony_ci} 30e484b35bSopenharmony_ci 31e484b35bSopenharmony_ciexport function fakeLogRestore() { 32e484b35bSopenharmony_ci fakeDebug.restore(); 33e484b35bSopenharmony_ci fakeInfo.restore(); 34e484b35bSopenharmony_ci fakeWarn.restore(); 35e484b35bSopenharmony_ci fakeError.restore(); 36e484b35bSopenharmony_ci} 37