What is the best way to pass the apiKey from the createUser function in User.ts to Test.ts in my specific scenario?
User.ts
interface User {
url: string,
name: string,
}
class User{
async createUser(
user: User
):Promise<void> {
let apiKey = await user.getUserApiKey(user.name);
console.log(`${user.name} api key - ${apiKey} received`);
return apiKey;
}
}
Test.ts
test("Smoke Test", async (t) => {
console.log(${apiKey} - User api key)
}