DenoDDeno
Powered by
fobbanF
Denoβ€’3y ago
fobban

Deno testing with local oak server

I'm trying to setup a simple oak application for a few tests. The test steps work as expected but I can't exit/close the oak application by aborting the signal without the test runner throwing an error.

BadResource: Bad resource ID
[...]
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.
BadResource: Bad resource ID
[...]
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.


I've setup a simple example to illustrate my issue:
deno test --allow-net=0.0.0.0 https://gist.githubusercontent.com/mlandalv/dca12ca72dcbb552a0fbecc27468310a/raw/4b401fb891b128052f48c1935be897a60c5d9ed2/example_test.ts
deno test --allow-net=0.0.0.0 https://gist.githubusercontent.com/mlandalv/dca12ca72dcbb552a0fbecc27468310a/raw/4b401fb891b128052f48c1935be897a60c5d9ed2/example_test.ts


Any help to figure out how to get this to work properly is greatly appreciated.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Issue with Deno (Oak?)
UC EnjoyerUUC Enjoyer / help
2y ago
HTTPS Oak Deno
ivandpfIivandpf / help
3y ago
Component testing with Deno
limLlim / help
3y ago
Deno Oak : Can't connect to SSE with Deno Deploy
lexandLlexand / help
3y ago