Jolo
Jolo4mo ago

Running test

Hey there, I am building a CLI and want to use Deno's test. However, in my VSCode the test runs successfully whereas when running deno test it doesn't. I have no idea which command VS Code is running (see image). Here is my function, i wanna test (btw. running deno run returns the right profiles):
import { loadSharedConfigFiles } from "npm:@aws-sdk/shared-ini-file-loader";

export async function getAllProfiles() {
try {
// Load profiles from credentials and config files
const profiles = await loadSharedConfigFiles();
// Get all profile names
const profileNames = Object.keys(profiles.configFile);

return profileNames;
} catch (error) {
console.error("Error loading profiles:", error);
throw error;
}
}
// `deno run` works
const profiles = await getAllProfiles();
console.log(profiles)
import { loadSharedConfigFiles } from "npm:@aws-sdk/shared-ini-file-loader";

export async function getAllProfiles() {
try {
// Load profiles from credentials and config files
const profiles = await loadSharedConfigFiles();
// Get all profile names
const profileNames = Object.keys(profiles.configFile);

return profileNames;
} catch (error) {
console.error("Error loading profiles:", error);
throw error;
}
}
// `deno run` works
const profiles = await getAllProfiles();
console.log(profiles)
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?