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 */ 15export let foo = {name: "123"} 16export let person = {age: 12, male: [1, 2, 3]} 17export class TestHelper { 18 constructor(testName) { 19 this.testName = testName; 20 this.passed = 0; 21 this.failed = 0; 22 } 23 24 test(testFunction, description) { 25 const result = testFunction(); 26 if (result) { 27 this.passed++; 28 console.log(`[PASS] ${this.testName}: ${description}`); 29 } else { 30 this.failed++; 31 console.error(`[FAIL] ${this.testName}: ${description}`); 32 } 33 } 34 35 getStats() { 36 return { 37 passed: this.passed, 38 failed: this.failed, 39 total: this.passed + this.failed 40 }; 41 } 42 43 printSummary() { 44 const stats = this.getStats(); 45 } 46} 47 48export class Machine { 49 name = "machine"; 50} 51 52export class User { 53 id; 54 constructor(a){ 55 this.id = a; 56 } 57} 58 59export class Person { 60 name; 61 age; 62 constructor(a, b){ 63 this.name = a; 64 this.age = b; 65 } 66} 67 68export class Employee { 69 name; 70 constructor(a = "employee"){ 71 this.name = a; 72 } 73}