GithubHelp home page GithubHelp logo

Consider upgrading to Jasmine 2 about jest HOT 42 CLOSED

facebook avatar facebook commented on April 24, 2024
Consider upgrading to Jasmine 2

from jest.

Comments (42)

chenglou avatar chenglou commented on April 24, 2024

👍

from jest.

johanneslumpe avatar johanneslumpe commented on April 24, 2024

This would be great - being able to use done() for async testing would really be welcome!

from jest.

odf avatar odf commented on April 24, 2024

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.

emorikawa avatar emorikawa commented on April 24, 2024

👍

from jest.

osdiab avatar osdiab commented on April 24, 2024

I agree! 👍 done() makes async tests so much nicer.

from jest.

messfromspace avatar messfromspace commented on April 24, 2024

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

NoumanSaleem avatar NoumanSaleem commented on April 24, 2024

👍 +1

from jest.

roderickhsiao avatar roderickhsiao commented on April 24, 2024

👍 @jeffmo How do you think

from jest.

lo1tuma avatar lo1tuma commented on April 24, 2024

👍

from jest.

cirocosta avatar cirocosta commented on April 24, 2024

👍

from jest.

ncuillery avatar ncuillery commented on April 24, 2024

👍

from jest.

fdubost avatar fdubost commented on April 24, 2024

Yeah, we need it! 👍

from jest.

kennydee avatar kennydee commented on April 24, 2024

👍

from jest.

oziks avatar oziks commented on April 24, 2024

👍

from jest.

cmeiller avatar cmeiller commented on April 24, 2024

👍

from jest.

axross avatar axross commented on April 24, 2024

👍

from jest.

randymorris avatar randymorris commented on April 24, 2024

Upgrading to Jasmine 2 would also fix equality issues like the one demonstrated here: https://gist.github.com/randymorris/439a85bccc856ca4e8c1.

from jest.

robrobbins avatar robrobbins commented on April 24, 2024

(thumbsup)
(plusone)
etc...

from jest.

robrobbins avatar robrobbins commented on April 24, 2024

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.

bartgryszko avatar bartgryszko commented on April 24, 2024

👍

from jest.

pedroteixeira avatar pedroteixeira commented on April 24, 2024

👍

from jest.

rosko avatar rosko commented on April 24, 2024

👍

from jest.

tewen avatar tewen commented on April 24, 2024

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

zupzup avatar zupzup commented on April 24, 2024

👍

from jest.

Cellule avatar Cellule commented on April 24, 2024

👍

from jest.

zol avatar zol commented on April 24, 2024

👍

from jest.

jeffmo avatar jeffmo commented on April 24, 2024

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.

akhomchenko avatar akhomchenko commented on April 24, 2024

Here is WIP update to jasmine 2.x: #330

Help wanted.

from jest.

MattyKuzyk avatar MattyKuzyk commented on April 24, 2024

I was struggling for an hour wondering why my done() wasn't working... ;__;

from jest.

akhomchenko avatar akhomchenko commented on April 24, 2024

Optional Jasmine 2.x support was added to #330

Thx to @tomv564

from jest.

 avatar commented on April 24, 2024

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.

chikamichi avatar chikamichi commented on April 24, 2024

Well, sir Bot, it's quite a relevant issue still 🍰 but human beings seem to be aware of that wrt #330

from jest.

cpojer avatar cpojer commented on April 24, 2024

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.

chikamichi avatar chikamichi commented on April 24, 2024

Oh I'm very patient @cpojer, I just wanted to interact with that inquiring bot of yours :)

from jest.

cpojer avatar cpojer commented on April 24, 2024

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.

cpojer avatar cpojer commented on April 24, 2024

See http://facebook.github.io/jest/docs/api.html#config-testrunner-string

from jest.

catalin-enache avatar catalin-enache commented on April 24, 2024

Thank you so much for Jasmine 2 support !

from jest.

quantuminformation avatar quantuminformation commented on April 24, 2024

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

catalin-enache avatar catalin-enache commented on April 24, 2024

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

cpojer avatar cpojer commented on April 24, 2024

You need --testRunner.

from jest.

quantuminformation avatar quantuminformation commented on April 24, 2024

I couldn't get --testRunner to run. I needed the extended one.

from jest.

github-actions avatar github-actions commented on April 24, 2024

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)

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.