2

I have an Angular 10 CLI project (v10.1.2). I've installed @testing-library/[email protected], and I want the nice matchers like .toBeInTheDocument(), but as I'm using Karma to run Jasmine (configured via Angular) and Typescript, I'm not sure how to install the @testing-library/jasmine-dom matchers?

I tried following the instructions for the latest version (v1.1.0), but while I can see the matchers on the HTMLMatchers type in VSCode, I can't actually add the Matchers. Trying to import them with import JasmineDOM from '@testing-library/jasmine-dom'; gives an error File C:/.../node_modules/@types/testing-library__jasmine-dom/index.d.ts is not a module.

As this is an Angular CLI project, with Jasmine behind Karma, would it actually make more sense to use a Karma plugin? (I can't see any...)

1 Answer 1

1

I halped the dev of jasmine-dom to fix a bug with the CSS library which was preventing my using it with Karma and we've updated the docs - so this should be pretty straightforward, now!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.