Issue with using Jasmine alongside jest-playwright
See original GitHub issueHello,
I was using Jasmine to add reporters and get name of a test with Puppeteer. After Playwright migration, it is no longer working.
My jest.setup.js looks like this:
jasmine.getEnv().addReporter({
specStarted: result => jasmine.currentTest = result,
specDone: result => jasmine.currentTest = result,
suiteStarted: result => jasmine.currentSuite = result,
suiteDone: result => jasmine.currentSuite = result,
});
Whenever I try to execute some tests, I am getting an error:
ReferenceError: jasmine is not defined
> 1 | jasmine.getEnv().addReporter({
| ^
2 | specStarted: result => jasmine.currentTest = result,
3 | specDone: result => jasmine.currentTest = result,
4 | suiteStarted: result => jasmine.currentSuite = result,
at Object.<anonymous> (test-environment/jest.setup.js:1:1)
Is there any possible solution?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Using Jest with Playwright
Using Jest with Playwright. In this blog post, we'll compare two Jest setups for creating and running end-to-end tests with Playwright.
Read more >Jest vs Mocha vs Jasmine: Comparing The Top 3 ...
In this blog, we compared three of the top JavaScript testing frameworks, i.e., Jest vs Mocha vs Jasmine - to help you pick...
Read more >Configuring Jest
Jest will run .mjs and .js files with nearest package.json 's type field set to module as ECMAScript Modules.
Read more >Test Group & Hooks | Playwright Tutorial - Part 25 - YouTube
Hello Guys, In this video, we'll discuss the test runner group and hooks.Source code:https://github.com/ortoniKC/ Playwright -Test-RunnerAfter ...
Read more >Why can't nested describe() blocks see vars defined in ...
The body of a describe block is executed before the beforeEach blocks. This is exactly as expected. The problem is that your var...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try to add to your jest.config.js: testRunner: “jasmine2”
This works for me.
Thanks @hananmalka, please reopen if the issue is still persistent. Its not intended to use it in combination with Jasmine but we are open to add guides / documentation for it if it works already.