Giter Site home page Giter Site logo

Comments (18)

reintroducing avatar reintroducing commented on May 14, 2024 1

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.

JamieMason avatar JamieMason commented on May 14, 2024

Apologies, this was missing. I've fixed this and released 2.0.0-beta4.

from jasmine-matchers.

Szpadel avatar Szpadel commented on May 14, 2024

Hello @JamieMason

I have beta4 installed and the issue is still present.
Could you double check this?

from jasmine-matchers.

mull avatar mull commented on May 14, 2024

I also saw this failing for beta4

from jasmine-matchers.

JamieMason avatar JamieMason commented on May 14, 2024

You're right @Szpadel @mull. Addressing it now, sorry about this.

from jasmine-matchers.

mull avatar mull commented on May 14, 2024

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.

JamieMason avatar JamieMason commented on May 14, 2024

Just published [email protected]

shakes head normally I'm more thorough, but I rushed this.

from jasmine-matchers.

JamieMason avatar JamieMason commented on May 14, 2024

karma-jasmine-matchers updated to 2.0.0-beta5 as well.

from jasmine-matchers.

Szpadel avatar Szpadel commented on May 14, 2024

With beta5 it's working fine, thanks.

from jasmine-matchers.

mull avatar mull commented on May 14, 2024

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.

JamieMason avatar JamieMason commented on May 14, 2024

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.

mull avatar mull commented on May 14, 2024

@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.

JamieMason avatar JamieMason commented on May 14, 2024

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.

mull avatar mull commented on May 14, 2024

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.

reintroducing avatar reintroducing commented on May 14, 2024

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.

JamieMason avatar JamieMason commented on May 14, 2024

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.

JamieMason avatar JamieMason commented on May 14, 2024

Example added: 12e464c.

from jasmine-matchers.

JamieMason avatar JamieMason commented on May 14, 2024

You're welcome, thanks.

from jasmine-matchers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.