Skip to content

Support Deno 2.0 #32

Open
Open
@andrija-tosic-rs

Description

Issue

Setup:

  • Deno Version: 2.0.0 (stable, release, aarch64-apple-darwin)
  • v8 Version: 12.9.202.13-rusty
  • Typescript Version: 5.6.2
  • SuperOak Version: 4.8.1

Details

Deno test started breaking after upgrading to Deno 2.0:

Test code:

Deno.test({
	name: 'init test',
	fn: async () => {
		const initReq = await superoak(app);
		const initRes = await initReq
			.post('/init')
			.set('Content-Type', 'application/json')
			.send(initPayloadDemo)
			.expect(Status.OK)

	sanitizeOps: false,
	sanitizeResources: false,
});
ERRORS 
./src/tests/play.test.ts (uncaught error)
error: (in promise) ReferenceError: window is not defined
      (window as any)[SHAM_SYMBOL].promises,
      ^
    at completeXhrPromises (https://deno.land/x/superdeno@4.9.0/src/test.ts:192:7)
    at https://deno.land/x/superdeno@4.9.0/src/test.ts:558:21
    at close (https://deno.land/x/superdeno@4.9.0/src/close.ts:47:52)
  
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.

Superoak still works fine on Deno 1.46.3, the latest Deno 1.x version before 2.0.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions