yarn jest "/folder1/test1.tsx|folder2/test2.tsx/gi" runs only first test - jestjs

I want to run multiple tests with jest regex, but it only runs the first one
The yarn jest "/folder1/test1.tsx|folder2/test2.tsx/gi" command runs only folder1/test1.tsx test suite

Related

My jest tests run fine separately but fail when run all routes together

I'm making an API using TypeScript, node.
I'm using jest to make some tests
I have two different routes, "/users" and "/authentication", when I run one route at a time it runs ok, but when I run all tests together one of my tests returns me a 500 status code.
I'm running it in node v16.17.0
jest: v29.3.1
When I run $npm run test users
When I run $npm run test authentication
When I run $npm run test
Thats my test scipts:
"test:load-envs": "dotenv -e .env.test", "test": "npm run test:load-envs npx jest",
I've tested it manually throught thunderClient and the error case runs fine...
On thunderClient trying to emulate the error:
I searched for someone with a similar error but I couldn't find an answer to my problem.
I can ignore this since it's a personal project, but I really would like to know how to solve it

.only does not work when running jest on multiple file coverage

describe.only() does not work when running jest --runInBand --forceExit --testTimeout=10000
when I use describe.skip() it works fine, but describe.only() is not working

Jest issues while running tests without flag --runInBand - my test fails

I'm having some problems with my node tests with jest.
When I write the command to run the tests without the --runInBand flag, some of my tests fail. And when I try to run with the --runInBand flag they all pass...
It's always a good option to use the --runInBand flag? Or I did something wrong?
(I'm working with some async tests...)

jasmine-node and bamboo - test failed

I using jasmine-node for testing node app, and have integration with bamboo, but the problem is when some of the test failed bamboo reports that command jasmine-node test-name.js exits with 1 and that on bamboo job dashboard I have label testless build without reports about tests.
Also I made wrapper in node to run that command and still getting that output of executing is 1.
Can I use this wrapper for bamboo, because I'm using --junitreport flag and artifact for junit tests?
Or I can setup jasmine-node to prevent throwing error if some of the test fails?
Just put the exit 0 at end of script in bamboo job.

How to run tests with gruntJS

So, how do I run the test suite in gruntjs? I thought it should be pretty simple and straight-forward but well, for me it wasn't :)
Since gruntjs should be able to run tests I thought that I could just run "grunt test", but that for some reason requires the server to run. I tried starting it in another process with "grunt server watch" but then again the "grunt test" fails.
How is grunt supposed to work?
'grunt test' is a task that starts server too when required. It starts a test runner, for example karma and karma runs the tests in browser environment.
The trick is to run karma and provide configuration items in karma.conf.js
A sample gruntfile on gruntjs website shows how to make qUnit work with grunt.

Resources