Comments (18)
That worked perfectly @JamieMason, thank you and thanks for this module, it's been a huge help when writing Jasmine tests previously and now with using Jest as well.
from jasmine-matchers.
Apologies, this was missing. I've fixed this and released 2.0.0-beta4.
from jasmine-matchers.
Hello @JamieMason
I have beta4 installed and the issue is still present.
Could you double check this?
from jasmine-matchers.
I also saw this failing for beta4
from jasmine-matchers.
You're right @Szpadel @mull. Addressing it now, sorry about this.
from jasmine-matchers.
No worries. I can test this within the next ~3 hrs (or tomorrow), let me know when you release and I'll see if it works :)
from jasmine-matchers.
Just published [email protected]
shakes head normally I'm more thorough, but I rushed this.
from jasmine-matchers.
karma-jasmine-matchers updated to 2.0.0-beta5 as well.
from jasmine-matchers.
With beta5 it's working fine, thanks.
from jasmine-matchers.
Works. Though I ran into a small problem, for some reason, that Jest started auto-mocking the module all of a sudden. It didn't before. Anyhow, I just added it to the list of unmocked packages and all is fine. Thanks for the work @JamieMason!
from jasmine-matchers.
Phew, great.
@mull would you mind showing how Jasmine-Matchers can be used with Jest? Someone mentioned before that they're compatible, but I've never seen for myself how it works.
Thanks.
from jasmine-matchers.
@JamieMason sure.
// package.json
"unmockedModulePathPatterns": [
"jasmine-expect"
],
//some test
import JasmineExpect from 'jasmine-expect';
...
expect(uniList).toBeNonEmptyArray();
expect(uniList).toBeArrayOfObjects();
Not any harder than that. AFAIK we're doing nothing special :-) We're moving away from Jest though, absolutely hate it!
from jasmine-matchers.
Thanks a lot @mull that's useful (may add it to the README). We looked at Jest at work for a while but decided against it in the end. The idea of automatic mocking though did sound like it could be quite nice.
from jasmine-matchers.
No problem! It is kind of nice sometimes. Jest is buggy though, and some of the options in the docs don't quite work. Especially combined with other options (one is somehow overriding the other.) It's been a messy journey so far.
from jasmine-matchers.
Is there any way to do this in a test-setup.js file that is executed with the setupFiles command from Jest? I'd like to just import this once and not have to worry about it in every single test file.
As of right now the only way I can get this working is to do this in each test file:
import JasmineExpect from 'jasmine-expect'; // eslint-disable-line no-unused-vars
It's kind of tedious and I expect another developer on the team will forget at some point and wonder why his tests are failing.
from jasmine-matchers.
I'll push an example up soon but the config you need I think @reintroducing is setupTestFrameworkScriptFile
{
"devDependencies": {
"jasmine-expect": "*",
"jest": "18.1.0"
},
"jest": {
"setupTestFrameworkScriptFile": "<rootDir>/node_modules/jasmine-expect/index.js",
"verbose": true
},
"private": true,
"scripts": {
"test": "jest"
}
}
from jasmine-matchers.
Example added: 12e464c.
from jasmine-matchers.
You're welcome, thanks.
from jasmine-matchers.
Related Issues (20)
- Usage from Jest in Typescript HOT 6
- toBeCloseToArray and toBeCloseToObject matches HOT 1
- Optional messages broken in 4.0.0 HOT 4
- Jasmine Matchers not working on Angular 7 and Karma HOT 11
- Jasmine-Matchers on protractor project. HOT 1
- Use `jasmine-expect` in `beforeAll` without `describe` will throw exception HOT 1
- toContainSubstring HOT 3
- Documentation on String Matchers is out of date
- Add support for withContext? HOT 2
- Typescript mismatch with toBeTrue/toBeFalse as of @types/jasmine 3.5.0 HOT 6
- Q: Does `npm install expect` support custom matchers? HOT 1
- Q: How to use with TypeScript? HOT 4
- Synchronize the release on github with the release on npm
- Property 'toBeWithinRange' does not exist on type 'Matchers<void>' HOT 8
- Update Browserstack browsers list
- Asymmetric Matchers not working in Jest HOT 1
- TypeScript error: All declarations of 'Matchers' must have identical type parameters. HOT 1
- Where are the <something>OrNull expectations? HOT 1
- Question: How to use jasmine-matchers with gulp-jasmine? HOT 1
- How to access Jasmine when it is an AMD module instead of a global? HOT 1
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 jasmine-matchers.