Commit Graph

28 Commits

Author SHA1 Message Date
Sophie Alpert
080db9d3a7 15.x: File headers BSD+Patents -> MIT 2017-09-25 17:02:43 -07:00
Flarnie Marchan
009c9f7201 Update tests to not warn due to moved PropTypes and shallowRenderer (#9486)
* Update tests to not warn due to moved PropTypes and shallowRenderer

We added some warnings in v15.5 for calling `React.PropTypes` and
calling the shallow renderer from the wrong place. These warnings were
causing test failures, and now they are fixed.

Most of these were for the `React.PropTypes` change.

* tweak from running prettier

* Final tweaks to get tests passing

**what is the change?:**
Updated 'PropTypes' and 'shallow renderer' syntax in a couple more
places to get tests passing.

**why make this change?:**
In order to verify any changes to the 15.6 and 15.* branches in general
we should have tests passing.

**test plan:**
`npm run test`

**issue:**
https://github.com/facebook/react/issues/9410
2017-04-24 18:48:20 -07:00
Christoph Pojer
96d39380fa Merge pull request #7625 from vjeux/jest15
Update to jest 15
(cherry picked from commit 1bd55c8cbd)
2016-10-03 17:31:41 -07:00
Sebastian Markbåge
21a4e7a826 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.
(cherry picked from commit c06a68a10b)
2016-10-03 16:08:28 -07:00
Keyan Zhang
e974383cba Add reactProdInvariant and corresponding babel rewrite pass (#6948)
(cherry picked from commit 1abce1630c)
2016-06-14 15:50:38 -07:00
Dan Abramov
c8b2a3dc13 Merge pull request #6872 from gaearon/jest-cli@12
Update to Jest 12.1.1 and Jasmine 2
(cherry picked from commit c0ecde687a)
2016-06-14 15:49:43 -07:00
Paul O’Shannessy
d945077f42 Merge pull request #6804 from dmitriiabramov/update_typescript
Update typescript
(cherry picked from commit 6a3e9d583b)
2016-06-14 15:34:27 -07:00
Ben Alpert
6638d49ad9 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.
(cherry picked from commit 6afd51061a)
2016-06-14 15:34:26 -07:00
Paul O’Shannessy
1573baaee8 Use Object.assign directly and inject object-assign at compile 2016-04-04 09:53:25 -07:00
Sebastian McKenzie
1365498b81 Update to Babel 6 2016-02-26 16:49:32 -08:00
cpojer
383e2f938d Update to jest-cli 0.9. 2016-02-17 13:01:14 +09:00
Paul O’Shannessy
7c52b802b4 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
0886273438 Fix few typos in React docs and comments 2015-12-13 16:39:07 +02:00
Paul O’Shannessy
b5d90f8c6b 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
d77e161f99 use path library to normalize filepath 2015-10-31 07:38:47 +09:00
Thomas Broadley
d80710b0ae fix for TypeScript test on Windows 2015-10-30 10:22:50 +09:00
Paul O’Shannessy
ad00a6e672 [lint] Make eqeqeq a failure 2015-10-27 15:39:54 -07:00
Sebastian Markbage
41cba2e77b 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
b8c7b13042 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
873e3a9816 Cleanup Jest preprocessor, use cache key 2015-09-23 13:46:41 -07:00
Paul O’Shannessy
2afc9a445f Upgrade to node@4, jest@0.5 2015-09-23 13:46:41 -07:00
Ben Alpert
31cb102650 Merge pull request #4762 from spicyj/ts
Make TypeScript test work with ReactDOM
2015-09-01 14:30:56 -07:00
Ben Alpert
589c8364b0 Make TypeScript test work with ReactDOM 2015-09-01 14:28:12 -07:00
Paul O’Shannessy
52b4c9eabf Upgrade to fbjs, fbjs-scripts @ 0.2 2015-08-31 17:19:42 -07:00
Ben Alpert
a8b6c8292b 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
ecb34de574 Upgrade ESLint, fix code 2015-08-10 17:04:29 -07:00
Paul O’Shannessy
be5c09c24d 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
1d0c1b1817 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