DenoDDeno
Powered by
JoloJ
Denoβ€’2y 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
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
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)
Screenshot_2024-10-27_at_09.35.42.png
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Running an npm-based Test Runner Using Deno?
Harsha509HHarsha509 / help
2y ago
`deno test` and VSCode test runner are failing to run all test files
theAbeTrainTtheAbeTrain / help
3y ago