• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16const path = require('path');
17
18const rootPath = path.resolve(__dirname, '../../../');
19const sdkPath = path.resolve(rootPath, './out/sdk/ohos-sdk/linux/ets/ets1.2');
20const pandaSdkPath = path.resolve(sdkPath, './build-tools/ets2panda');
21const apiPath = path.resolve(sdkPath, './api');
22
23module.exports = {
24    testEnvironment: 'node',
25    transform: {
26        '^.+\\.ts$': ['ts-jest'],
27    },
28    testRegex: './test/ut/.+\\.test\\.ts$',
29    moduleFileExtensions: ['ts', 'js', 'json', 'node'],
30    coverageDirectory: './test/report',
31    collectCoverageFrom: [
32        'common/**',
33        'memo-plugins/**',
34        'ui-plugins/**'
35    ],
36    coveragePathIgnorePatterns: [
37        'common/debug.ts',
38        'common/etsglobal-remover.ts',
39        'common/print-visitor.ts',
40        'common/plugin-context.ts',
41        'memo-plugins/index.ts',
42        'memo-plugins/import-transformer.ts',
43        'memo-plugins/memo-transformer.ts',
44        'ui-plugins/index.ts',
45        'ui-plugins/printer-transformer.ts',
46        'ui-plugins/builder-lambda-translators/builder-lambda-transformer.ts',
47        'ui-plugins/entry-translators/entry-transformer.ts',
48        'ui-plugins/struct-translators/struct-transformer.ts'
49    ],
50    verbose: true,
51    globals: {
52        SDK_PATH: sdkPath,
53        PANDA_SDK_PATH: pandaSdkPath,
54        API_PATH: apiPath,
55    },
56};
57