Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple errors when running the test #2

Open
cdoremus opened this issue Mar 15, 2023 · 0 comments
Open

Multiple errors when running the test #2

cdoremus opened this issue Mar 15, 2023 · 0 comments

Comments

@cdoremus
Copy link

Running the test from the command line produces the following error:

craig@craig-G750JX:~/git/deno/deno-dom-test$ deno test --allow-env
Download https://deno.land/std@0.170.0/node/_crypto/crypto_browserify/asn1.js/de
error: The source code is invalid, as it does not match the expected hash in the lock file.
  Specifier: https://esm.sh/@testing-library/jest-dom@5.16.5/matchers
  Lock file: /home/craig/git/deno/deno-dom-test/deno.lock

When I deleted the lock file and recreated it on the command line, I got this error:

craig@craig-G750JX:~/git/deno/deno-dom-test$ deno test --allow-env --lock=deno.lock --lock-write
error: Remote modules are not allowed to import local modules. Consider using a dynamic import instead.
  Importing: file:///home/craig/git/deno/deno-dom-test/lib/std/node/vm.ts
    at https://esm.sh/v102/jsdom@20.0.3/deno/jsdom.js:2:1266

I then upgraded jsdom to v21.1.1, but that caused the test to fail:

craig@craig-G750JX:~/git/deno/deno-dom-test$ deno test --allow-env
error: The source code is invalid, as it does not match the expected hash in the lock file.
  Specifier: https://esm.sh/@testing-library/jest-dom@5.16.5/matchers
  Lock file: /home/craig/git/deno/deno-dom-test/deno.lock
craig@craig-G750JX:~/git/deno/deno-dom-test$ deno test --allow-env --lock=deno.lock --lock-write
Uncaught error from ./index.test.tsx FAILED

 ERRORS 

./index.test.tsx (uncaught error)
error: Error: Not implemented: isContext
  throw new Error(message);
        ^
    at notImplemented (https://deno.land/std@0.177.0/node/_utils.ts:23:9)
    at Object.isContext (https://deno.land/std@0.177.0/node/vm.ts:62:3)
    at new bme (https://esm.sh/v102/jsdom@21.1.1/deno/jsdom.js:800:91203)
    at M3.createWindow (https://esm.sh/v102/jsdom@21.1.1/deno/jsdom.js:800:88770)
    at new vy (https://esm.sh/v102/jsdom@21.1.1/deno/jsdom.js:800:106285)
    at file:///home/craig/git/deno/deno-dom-test/test_globals.ts:3:13
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 

./index.test.tsx (uncaught error)

FAILED | 0 passed | 1 failed (560ms)

error: Test failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant