Commit Graph
29 Commits
Author SHA1 Message Date
Ben AlpertandGitHub 44a12ba71b Build infra for tracking dev-specific failures (#8228)
I'll plan to change all of our console.error and component-tree expects to expectDev. It's a little annoying that we need to make sure tests don't throw (see my change to normalizeCodeLocInfo) but any alternative would seem to require two separate test runs or a much more cumbersome syntax.
2016-11-13 14:00:07 -08:00
Ben AlpertandGitHub 390224f10f Track passing/failing tests in fiber (#8169)
* Work around jest toEqual bug in ReactTreeTraversal

![image](https://cloud.githubusercontent.com/assets/6820/19879640/1cd7595a-9fb2-11e6-94ac-8c38bdfc90d3.png)

* Track passing/failing tests in fiber

Run scripts/fiber/record-tests to re-record, then check git diff to see what you changed.
2016-10-31 23:26:38 -07:00
Christopher Chedeau 9cf66a9871 Update to jest 15
Jest 15 has just been released and is way more awesome: http://facebook.github.io/jest/blog/2016/09/01/jest-15.html

This pull request updates jest from version 12 to 15. Right now there's a fix in jest around Symbol that hasn't been released yet, so this will break CI and cannot be merged it. But once it ships by the end of the day, we'll be good to go :)

See comments inline for all the changes I've done.
2016-08-31 18:25:03 -07:00
Sebastian MarkbågeandGitHub 026612fa66 Mock ReactDOM for Fiber Tests (#7206)
We currently write all our tests against the DOM implementation.
I need a way to run the Fiber tests against it. But I don't want
to take on any package dependencies on Fiber modules yet.

There's a problem with jest right now where you can't globally
mock modules that already exist. So I have to add a global call
to jest.mock.

Luckily we already have a way to test the useCreateElement paths
using a feature flag. I won't activate this flag in travis until
it passes, but the idea is to run all three variants in travis.

I'm not sure that invoking rAF and rIC synchronously is the best
way to test this since it doesn't capture the backwards
compatibility aspect. I.e. the fact that people might be relying
on the synchronous nature in real apps too. It's a start.

Ideally, jest would have these built-in.
2016-08-10 17:44:36 -07:00
Keyan Zhang 83d3eb25a4 Add reactProdInvariant and corresponding babel rewrite pass (#6948) 2016-06-07 17:11:04 -07:00
Paul O’ShannessyandDan Abramov 4aad796a39 Upgrade to [email protected] and use Jasmine2 2016-05-25 21:48:32 +01:00
Dmitrii Abramov 3151a37109 match jest.d.ts by regex 2016-05-19 19:24:40 -07:00
chicoandDmitrii Abramov 57bfa0ae9e update typescript 2016-05-19 19:24:40 -07:00
Ben Alpert 35b61a86a7 Embed JSX filename paths relative to repo root (#6778)
Test Plan: Changed the preprocessor to log the output of babel.transform and saw

```
var _jsxFileName = 'src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js';
```

in the resulting output, instead of an absolute path.
2016-05-16 11:15:12 -07:00
Paul O’Shannessy fc707182e4 Use Object.assign directly and inject object-assign at compile 2016-04-04 09:53:25 -07:00
Sebastian McKenzie 48518b1c8a Update to Babel 6 2016-02-26 16:49:32 -08:00
cpojer c27fcaf4c5 Update to jest-cli 0.9. 2016-02-17 13:01:14 +09:00
Paul O’Shannessy ff3fccf40a Clean up ununsed devDeps
Also removed object-assign. We only support building with node v4+ which has Object.assign.
2016-01-22 10:17:30 -08:00
Justas Brazauskas 0c5ee5937c Fix few typos in React docs and comments 2015-12-13 16:39:07 +02:00
Paul O’Shannessy 16df9a39c4 Merge pull request #5331 from tbroadley/typescript-test-windows
Fix for TypeScript test on Windows
2015-10-30 15:45:51 -07:00
Thomas Broadley e38dee66e7 use path library to normalize filepath 2015-10-31 07:38:47 +09:00
Thomas Broadley 419006e2e7 fix for TypeScript test on Windows 2015-10-30 10:22:50 +09:00
Paul O’Shannessy 571f953cfe [lint] Make eqeqeq a failure 2015-10-27 15:39:54 -07:00
Sebastian Markbage 83a02f2a4c Enforce NODE_ENV=test
You could make the argument that this should be optional, but it doesn't
work without it so we might as well just enforce it.

Makes `jest` work by default.
2015-09-30 17:43:06 -07:00
Ben Alpert 7c825a3dcd Fail jest tests on any un-spied warnings
Originally #4223 -- we lost this when we switched to jest.
2015-09-29 17:35:39 -07:00
Paul O’Shannessy 25690e6151 Cleanup Jest preprocessor, use cache key 2015-09-23 13:46:41 -07:00
Paul O’Shannessy e75aefee3b Upgrade to node@4, [email protected] 2015-09-23 13:46:41 -07:00
Ben Alpert 2b7b3db61e Merge pull request #4762 from spicyj/ts
Make TypeScript test work with ReactDOM
2015-09-01 14:30:56 -07:00
Ben Alpert 2c2cf90bca Make TypeScript test work with ReactDOM 2015-09-01 14:28:12 -07:00
Paul O’Shannessy 739e183ec4 Upgrade to fbjs, fbjs-scripts @ 0.2 2015-08-31 17:19:42 -07:00
Ben Alpert e435c17ffc hax to make jest fast
Turns out jest is _incredibly_ slow at resolving require paths like `require('fbjs/lib/foo')`. Like several milliseconds per require. Really adds up when all our files require `invariant` and `warning`. Here's a temporary hack to make things fast again.

Test Plan:
```
npm test src/renderers/shared/reconciler/__tests__/ReactCompositeComponent-test.js
```

has a self-proclaimed runtime of ~8 seconds now instead of ~35 seconds.
2015-08-18 21:40:58 -07:00
Paul O’Shannessy a53121eda1 Upgrade ESLint, fix code 2015-08-10 17:04:29 -07:00
Paul O’Shannessy 90d84ebf7d Update fbjs dependency
- remove a file that got moved over there
- update for renamed babel transform
2015-07-27 13:37:48 -07:00
Paul O’Shannessy 1c5742119a Use fbjs package from npm, gulp
This reworks a few things in building and distributing React. The biggest change is using fbjs to share dependencies with other libraries. We're also using Gulp for some build steps.
2015-07-23 15:48:02 -07:00