Comments (42)
👍
from jest.
This would be great - being able to use done() for async testing would really be welcome!
from jest.
Any news on that? Ironically, I've found that exactly the tests I moved from plain Jasmine to Jest for in order to simplify my tooling - CSP code that requires ES6 generators - don't work any longer.
from jest.
👍
from jest.
I agree! 👍 done()
makes async tests so much nicer.
from jest.
👍 I actively use CSP (via js-csp), so it would be pretty nice if I could do something like this:
go(function *() {
var value;
value = yield take(makeAsyncThing());
expect(value).toEqual('whatever');
done();
});
from jest.
👍 +1
from jest.
👍 @jeffmo How do you think
from jest.
👍
from jest.
👍
from jest.
👍
from jest.
Yeah, we need it! 👍
from jest.
👍
from jest.
👍
from jest.
👍
from jest.
👍
from jest.
Upgrading to Jasmine 2 would also fix equality issues like the one demonstrated here: https://gist.github.com/randymorris/439a85bccc856ca4e8c1.
from jest.
(thumbsup)
(plusone)
etc...
from jest.
related question: Has anyone dropped in 2.x to see what happens? may not be too bad to fix. OSS and all... (puts on todo list)
from jest.
👍
from jest.
👍
from jest.
👍
from jest.
@robrobbins Tried that yesterday. Wanted to limit the amount of time I spent doing it (time boxed to an hour). It's not a simple replacement. I also realized (shortly after) that the jest team would have done this if it was that easy.
👍
from jest.
👍
from jest.
👍
from jest.
👍
from jest.
Just wanted to follow up here to say that I don't have any immediate plans to build out Jasmine2 support, but only for lack of cycles myself. However, if someone wanted to take a crack at building a jasmine2TestRunner
, I'd happily take a PR for such a thing.
You can take a look at the existing jasmineTestRunner
:
https://github.com/facebook/jest/blob/master/src/jasmineTestRunner/jasmineTestRunner.js
It should be possible to build a jasmine2TestRunner
that matches the same API as that runner function. Then it'll be easy to toggle between the two test runners (and even other test runners!) via this config option:
https://github.com/facebook/jest/blob/master/src/lib/utils.js#L29
from jest.
Here is WIP update to jasmine 2.x: #330
Help wanted.
from jest.
I was struggling for an hour wondering why my done() wasn't working... ;__;
from jest.
Optional Jasmine 2.x support was added to #330
Thx to @tomv564
from jest.
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
from jest.
Well, sir Bot, it's quite a relevant issue still 🍰 but human beings seem to be aware of that wrt #330
from jest.
Yes yes, we are working on this. There is a lot of work that we need to do to make jest awesome and I'm still working through the backlog of things we need to do at Facebook. Please have a little bit more patience and I will make sure jest is great soon!
(I assigned this issue to me, hoping that will shut up our bot. cc @vjeux)
from jest.
Oh I'm very patient @cpojer, I just wanted to interact with that inquiring bot of yours :)
from jest.
jest 0.8.0 was published just now with optional jasmine2 support! Thanks everyone and I'm deeply sorry for the long wait.
from jest.
See http://facebook.github.io/jest/docs/api.html#config-testrunner-string
from jest.
Thank you so much for Jasmine 2 support !
from jest.
@cpojer how do I specify this in the command line? I tried this but I still get jasmine1 being used
"scripts": {
"test": "jest -testRunner = 'node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js"
},
[email protected] test /Users/nikos/PhpstormProjects/JestAjaxTest
jest -testRunner = node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js
Using Jest CLI v0.8.2, jasmine1
from jest.
@quantuminformation
I was able to enable Jasmine2 with the following config:
"jest": {
"testRunner": "<rootDir>/node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js",
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react",
"<rootDir>/node_modules/react-dom",
"<rootDir>/node_modules/react-addons-test-utils",
"<rootDir>/node_modules/fbjs"
],
"moduleFileExtensions": ["js", "jsx"],
"testFileExtensions": ["js", "jsx"]
},
"scripts": {
"test": "jest"
}
https://github.com/catalin-enache/ab_utils/blob/master/package.json
from jest.
You need --testRunner
.
from jest.
I couldn't get --testRunner to run. I needed the extended one.
from jest.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
from jest.
Related Issues (20)
- [Bug]: coverageThreshold for single path is not working
- [Docs]: Egghead.io link on snapshot testing docs page is broken
- [Bug]: Jest duplicates modules imported in both global setup/teardown and code under test
- [Bug]: jest-util is missing a dependency on jest-regex-util (and error is misleading) HOT 2
- [Docs]: Links to older versions of docs are broken
- Error: Uncaught [TypeError: Cannot read properties of undefined (reading 'chain')][Bug]:
- Failed build: Node Nightly CI HOT 3
- ReferenceError: expect is not defined at \backend\src\v1\Backend.ts:118:25 at processTicksAndRejections (node:internal/process/task_queues:95:5) HOT 1
- [Feature]: Allow cases in different suites in the same test file to have the same name.
- [Bug]: failureMessage is coloured when syntax errors HOT 3
- I'm updated my react-native project-v0.73.4 with jest-v29.6.3 after my api test cases are failing.
- [Feature]: Support tc39 "import attributes" HOT 1
- [Feature]: Expose more information in JSON results when there is a suite-level error
- [Feature]: Including the Hooks in the jest.retryTimes
- [Feature]: testEnvironment per file type
- [Bug] `URLSearchParams.delete` Execution results differ HOT 1
- [Bug]: expect URL objects are compared by href HOT 1
- [Bug]: Asymmetric matchers in error of observable are timing out instead of failing
- [Feature]: support biome for jest-snapshot formatting
- [Feature]: Dynamic test retries based on error messages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest.