bzm3r
bzm3r
DDeno
Created by bzm3r on 4/6/2025 in #help
The requested module 'npm:@jest/globals' does not provide an export named 'describe'
I am doing some exercies on exercism in the Typescript track, but I want to run my solutions locally on my machine using deno. So I have a folder, and in it I have two files (two-fer.ts and two-fer.test.ts):
export function twoFer(name: string = "you"): string {
return `One for ${name}, one for me.`;
}

console.log(twoFer());
console.log(twoFer("it"));
export function twoFer(name: string = "you"): string {
return `One for ${name}, one for me.`;
}

console.log(twoFer());
console.log(twoFer("it"));
import { describe, it, expect, xit } from "npm:@jest/globals";

import { twoFer } from "./two-fer.ts";

describe("TwoFer", () => {
it("no name given", () => {
const expected = "One for you, one for me.";

expect(twoFer()).toEqual(expected);
});

xit("a name given", () => {
const expected = "One for Alice, one for me.";

expect(twoFer("Alice")).toEqual(expected);
});

xit("another name given", () => {
const expected = "One for Bob, one for me.";

expect(twoFer("Bob")).toEqual(expected);
});
});
import { describe, it, expect, xit } from "npm:@jest/globals";

import { twoFer } from "./two-fer.ts";

describe("TwoFer", () => {
it("no name given", () => {
const expected = "One for you, one for me.";

expect(twoFer()).toEqual(expected);
});

xit("a name given", () => {
const expected = "One for Alice, one for me.";

expect(twoFer("Alice")).toEqual(expected);
});

xit("another name given", () => {
const expected = "One for Bob, one for me.";

expect(twoFer("Bob")).toEqual(expected);
});
});
I ran deno add --allow-scripts npm:@jest/globals, but when I run deno test, I get the error:
./twofer.test.ts (uncaught error)
error: SyntaxError: The requested module 'npm:@jest/globals' does not provide an export named 'describe'
import { describe, it, expect, xit } from "npm:@jest/globals";
^
at <anonymous> (file:///home/bzm3r/learn-ts/two-fer.test.ts:1:10)
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.

FAILURES

./twofer.test.ts (uncaught error)
./twofer.test.ts (uncaught error)
error: SyntaxError: The requested module 'npm:@jest/globals' does not provide an export named 'describe'
import { describe, it, expect, xit } from "npm:@jest/globals";
^
at <anonymous> (file:///home/bzm3r/learn-ts/two-fer.test.ts:1:10)
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.

FAILURES

./twofer.test.ts (uncaught error)
Any ideas on what might be casuing this problem?
1 replies
DDeno
Created by bzm3r on 2/8/2025 in #help
Writing a script to check which process is locking a file on Windows?
I want to write a TypeScript script which lets me check which process is locking a file on Windows. I would like to run it using Deno. I checked through the packages of the standard library to see what might be relevant, and the fs package stood out, but it doesn't provide any functions that may be relevant. So how would you go about implementing such a script to run with Deno?
1 replies
DDeno
Created by bzm3r on 1/27/2024 in #help
Good scripts/tools to automate conversion of Node.js based projects to Deno?
I'm wondering if there are commendations for tools like this? (I found something like this, but it seems to be kind of unmaintained: https://deno.land/x/nodedeno@v0.2.12)
3 replies
DDeno
Created by bzm3r on 1/27/2024 in #help
VS Code Extension API development with Deno as a runtime?
I'm dipping my toes into VS Code extension development. I only have Deno on my machine (for sanity), so the default template created by yo doesn't work out of the box. But I'd like to use it as a template to get going, and I'm wondering if I can have some help as I walk through this? Actually, is what I'm thinking of doing even possible/sensical?
15 replies
DDeno
Created by bzm3r on 10/19/2022 in #help
VS Code, Hello World -- F5 shows nothing in console?
I have a simple hello world program:
let message: string = 'Hello World';
console.log(message);
let message: string = 'Hello World';
console.log(message);
When I hit F5 though, I don't see any output in the debug console, unless I set "outputCapture: "std" in my launch.json but this seems to be counter to the behaviour I would expect? I would expect the debug console to show the output, since it is the debug console?
2 replies