New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider upgrading to Jasmine 2 #74

Closed
n1k0 opened this Issue Jun 15, 2014 · 41 comments

Comments

Projects
None yet
@n1k0
Copy link

n1k0 commented Jun 15, 2014

Async support in Jasmine 1.3 is pretty poor, this has been fixed in version 2 of the framework. Maybe we should consider upgrading to that version.

@chenglou

This comment has been minimized.

Copy link
Contributor

chenglou commented Jul 10, 2014

👍

@johanneslumpe

This comment has been minimized.

Copy link

johanneslumpe commented Jul 12, 2014

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

@odf

This comment has been minimized.

Copy link

odf commented Oct 22, 2014

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.

@emorikawa

This comment has been minimized.

Copy link

emorikawa commented Oct 22, 2014

👍

@osdiab

This comment has been minimized.

Copy link

osdiab commented Nov 9, 2014

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

@osdiab osdiab referenced this issue Nov 9, 2014

Closed

Async tests #42

@messfromspace

This comment has been minimized.

Copy link

messfromspace commented Nov 14, 2014

👍 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();
});
@NoumanSaleem

This comment has been minimized.

Copy link

NoumanSaleem commented Dec 7, 2014

👍 +1

@roderickhsiao

This comment has been minimized.

Copy link

roderickhsiao commented Dec 8, 2014

👍 @jeffmo How do you think

@lo1tuma

This comment has been minimized.

Copy link

lo1tuma commented Dec 22, 2014

👍

2 similar comments
@cirocosta

This comment has been minimized.

Copy link
Contributor

cirocosta commented Jan 5, 2015

👍

@ncuillery

This comment has been minimized.

Copy link
Contributor

ncuillery commented Jan 8, 2015

👍

@fdubost

This comment has been minimized.

Copy link

fdubost commented Jan 8, 2015

Yeah, we need it! 👍

@kennydee

This comment has been minimized.

Copy link

kennydee commented Jan 9, 2015

👍

3 similar comments
@oziks

This comment has been minimized.

Copy link

oziks commented Jan 9, 2015

👍

@cmeiller

This comment has been minimized.

Copy link

cmeiller commented Jan 9, 2015

👍

@axross

This comment has been minimized.

Copy link

axross commented Jan 16, 2015

👍

@randymorris

This comment has been minimized.

Copy link

randymorris commented Jan 20, 2015

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

@robrobbins

This comment has been minimized.

Copy link

robrobbins commented Jan 20, 2015

(thumbsup)
(plusone)
etc...

@robrobbins

This comment has been minimized.

Copy link

robrobbins commented Jan 20, 2015

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)

@bartgryszko

This comment has been minimized.

Copy link

bartgryszko commented Feb 9, 2015

👍

2 similar comments
@pedroteixeira

This comment has been minimized.

Copy link

pedroteixeira commented Feb 19, 2015

👍

@rosko

This comment has been minimized.

Copy link

rosko commented Feb 20, 2015

👍

@tewen

This comment has been minimized.

Copy link

tewen commented Mar 4, 2015

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

👍

@zupzup

This comment has been minimized.

Copy link

zupzup commented Mar 16, 2015

👍

2 similar comments
@Cellule

This comment has been minimized.

Copy link

Cellule commented Mar 17, 2015

👍

@zol

This comment has been minimized.

Copy link

zol commented Apr 2, 2015

👍

@jeffmo

This comment has been minimized.

Copy link
Member

jeffmo commented Apr 2, 2015

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

@gagoman

This comment has been minimized.

Copy link

gagoman commented Apr 14, 2015

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

Help wanted.

@MattyKuzyk

This comment has been minimized.

Copy link

MattyKuzyk commented Apr 23, 2015

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

@gagoman

This comment has been minimized.

Copy link

gagoman commented May 20, 2015

Optional Jasmine 2.x support was added to #330

Thx to @tomv564

@ghost

This comment has been minimized.

Copy link

ghost commented Aug 4, 2015

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.

@chikamichi

This comment has been minimized.

Copy link

chikamichi commented Sep 29, 2015

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

@cpojer cpojer self-assigned this Sep 29, 2015

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Sep 29, 2015

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)

@chikamichi

This comment has been minimized.

Copy link

chikamichi commented Sep 29, 2015

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

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Nov 19, 2015

jest 0.8.0 was published just now with optional jasmine2 support! Thanks everyone and I'm deeply sorry for the long wait.

@cpojer cpojer closed this Nov 19, 2015

@cpojer

This comment has been minimized.

@catalin-enache

This comment has been minimized.

Copy link

catalin-enache commented Jan 6, 2016

Thank you so much for Jasmine 2 support !

@QuantumInformation

This comment has been minimized.

Copy link

QuantumInformation commented Jan 25, 2016

@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"
  },

JestAjaxTest@1.0.0 test /Users/nikos/PhpstormProjects/JestAjaxTest
jest -testRunner = node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js

Using Jest CLI v0.8.2, jasmine1

@catalin-enache

This comment has been minimized.

Copy link

catalin-enache commented Jan 26, 2016

@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

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Jan 26, 2016

You need --testRunner.

@QuantumInformation

This comment has been minimized.

Copy link

QuantumInformation commented Jan 29, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment