JoloJ
Deno14mo ago
Jolo

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)
Screenshot_2024-10-27_at_09.35.42.png
Was this page helpful?