Commit Graph

53 Commits

Author SHA1 Message Date
Simen Bekkhus d6baacfe74
feat: Refer to specific versions of Jest monorepo dependencies instead of range (#14553) 2023-09-20 12:52:18 +00:00
Simen Bekkhus 149383e258
fix(pretty-format): Handle empty string children in React same as `react-test-renderer` (#14470) 2023-09-19 13:16:01 +02:00
Paul O’Shannessy 6d2632adae
Update copyrights with Meta Platforms, restore original license in Jasmine fork (#13879) 2023-02-09 08:13:08 +01:00
Simen Bekkhus fc8562dcae
chore: add some missing dev dependencies (#13837) 2023-01-28 17:20:27 +01:00
Simen Bekkhus b9282e1972
chore: refresh lockfile (#13798) 2023-01-23 10:59:28 +01:00
Tom Mrazauskas 8219820a87
chore(lint): use `jest/prefer-to-be` rule (#13369) 2022-10-03 14:07:11 +02:00
Tom Mrazauskas c6b812da65
chore: remove lint exceptions for files in `examples` folder (#13346) 2022-10-01 08:01:13 +01:00
Bryan Mishkin 818b36b89a
chore: fix inconsistent workspace prefixes (#13217) 2022-09-08 11:29:38 +02:00
Feng Yu ccecdaeaae
Enforce same version of a dependency (#12668) 2022-04-19 12:48:43 +02:00
Nicolas Charpentier e3c84b54d6
chore: update React examples to match with the new React guidelines (#12217) 2022-02-11 08:31:28 +01:00
Simen Bekkhus 7399d48f02
chore: get rid of warnings when running react tests (#11821) 2021-09-08 09:26:06 +02:00
Nicolas Charpentier 040a50b725
docs: use function components in React examples (#11329) 2021-04-23 07:20:24 +02:00
Simen Bekkhus 30b6cee924
chore: default to node test env rather than browser (#9874) 2020-11-04 17:47:02 +01:00
Simen Bekkhus 1c2011dbce
chore: verify all packages have the same engine requirement (#9871) 2020-04-23 20:19:29 +02:00
Abhishek Jain 220835cc03 refactor: Replaces findDomNode() with refs (#9124) 2019-11-02 11:48:04 +01:00
Vinicius 16930281c4 [React Test Example] Fixed babel to example tests (#8963) 2019-09-18 16:29:46 +02:00
Mark de Dios 4f06ee4881 chore: use property initializer syntax (#8117) 2019-03-14 17:05:09 +01:00
Simen Bekkhus 5f7c3e4e12
Bump some dev dependency versions (#8044) 2019-03-04 18:55:52 +01:00
Michał Pierzchała 64b3a9b72b
chore(breaking): remove regenerator-runtime injection (#7595)
* feat: use @babel/plugin-transform-runtime instead of regenerator-runtime

* fix async example

* add changelog

* add babel/core and babel-jest to all examples

* fix native async test

* chore: dedupe lockfile

* remove babel from native transform test

* add test for async regenerator
2019-01-20 11:43:57 +01:00
Simen Bekkhus cdef699a81
chore: remove unused eslint disable comments (#7640) 2019-01-16 18:46:27 +01:00
Simen Bekkhus 1818d84b2c
Migrate to Babel 7 (#7016) 2018-12-18 10:28:03 +01:00
Terrence Wong 5b7c75d4c3 Add react testing library example (#7346)
* docs: add react-testing-library example

* chore: rename test files to match comments in docs

* docs: show react-testing-library example first then enzyme
2018-11-09 18:48:40 +00:00
Michał Pierzchała d1ce3cd013 chore: upgrade deps (#6400)
* chore: upgrade deps

* upgrade more packages

* upgrade micromatch

* use jest-junit as a reporter

* downgrade slash to 1.0.0 for now

* revert fbjs incompatible eslint plugins

* Revert eslint

* bring back eslint update because fbjs published new version:

* revert rn react upgrade

* update eslint-plugin-babel peerDep
2018-06-21 20:06:35 +01:00
Michał Pierzchała f0b12711bd Upgrade deps and include examples in workspaces (#6090)
* chore: bump deps

* remove snapshot that shouldn't be checked out

* include examples in workspaces

* mark examples as private

* move pretty-format dev deps to the package; remove enzyme from root pkg

* fix immutable entry
2018-04-30 10:00:08 +01:00
Rick Hanlon II 442e93d488 Update to React 16, handle React.Fragment better (#5816)
* Add React.Fragment to snapshots in unhandled cases

* Add test

* Upgrade to React 16

* Fix flow

* Convert to class component
2018-03-18 08:39:07 +00:00
anraka 21a2b7aaee Consistent naming of files (#3798) 2017-06-23 12:00:04 -07:00
Michał Pierzchała 8c2a65120a Prettier 1.2.2, refactor runCommand (#3352)
* Prettier 1.2.2, refactor runCommand

* Fix test-examples

* Run prettier on examples and scripts

* Fix integration_tests

* Disable esilnt's computed-property-spacing
2017-04-25 16:16:08 +01:00
Christoph Pojer 0650967244 Add all example dependencies to the top level. (#3313) 2017-04-18 11:01:08 -07:00
Eric Nakagawa 3fc7e9251a Updated examples to use updated Babel 'env' preset (#3303)
* Updating to use Babel env

Updating getting started

Updating enzyme to use babel 'env'

Updating jquery example to use babel 'env'

Updated manual_mocks example to use babel 'env'

Updated react test to use babel 'env'

Updated react-native to use babel 'env'

Update to use babel 'env'

Removed yarn.lock files

* * version

* * version

* * version

* * version

* Update .babelrc
2017-04-17 08:57:51 -07:00
Michał Pierzchała e08c81e18b Replace babel-polyfill with only regenerator-runtime (#2755) 2017-02-27 10:26:36 +00:00
Michał Pierzchała 8fc57da6c7 Rename jest-cli to jest in examples (#2379) 2016-12-20 16:27:29 +00:00
Joe Egan 33db303a26 Fix peerinvalid npm error in react example (#1616) 2016-09-05 13:25:44 -07:00
cpojer fed449c226 Changelog, get rid of `describe` in docs, fix thrown error printing, update new default error messages. 2016-08-31 19:02:14 +01:00
Christoph Pojer 3bbf32a239 New defaults for Jest. (#1511) 2016-08-30 11:07:15 +01:00
Christoph Pojer 25b8369291 Use `vm.Script` and refactor coverage caching. (#1239)
* Use `vm.Script`.

* Rewrite basic coverage support in Jest.

* Move `vm.Script` creation and caching into `transform`.

* Copy all jest packages into example folders.

This ensures we are using the latest version of every package.

* Cache the wrapped code.

* Use babel-jest for Jest itself; update setup.

* Added a transform.js test.
* Relax jest.mock babel transform restrictions.
* Updated package.json and .npmignore for all packages.

* Make watch script resilient to deleted files.
2016-07-07 16:43:12 +09:00
cpojer ff79d1920d Update snapshot example. 2016-06-29 13:51:27 +09:00
Richard e4969781f8 Prevent examples from unintentionally un-mocking all react* modules
Summary:
As discussed in reactiflux, I've updated the examples and docs so similarly named modules will no longer be un-mocked by mistake.
Closes https://github.com/facebook/jest/pull/989

Differential Revision: D3288337

fbshipit-source-id: 1cc1220506050ae6b4fece24690902052be4c89e
2016-05-11 11:37:45 -07:00
Jason Quense b2d561861c no "use strict" in a es6 module context
Summary:
Since modules are strict by default its a bit odd. super tiny nit.
Closes https://github.com/facebook/jest/pull/958

Differential Revision: D3240744

fb-gh-sync-id: a8e32b3c22cad7b04ea10ff282d4b5dbd33d21b2
fbshipit-source-id: a8e32b3c22cad7b04ea10ff282d4b5dbd33d21b2
2016-04-29 05:46:21 -07:00
cpojer 40db699e8b Update eslint rules and clean up code.
Summary:We spend too much time reviewing minor nits and it increases turnaround time. This updates the eslint config to error on a few stylistic things and it is now aligned with the Jest code style.

This was also a good change (or well, I was forced :P ) to clean up the last of the cruft of the codebase :)
Closes https://github.com/facebook/jest/pull/892

Reviewed By: vjeux

Differential Revision: D3178752

fb-gh-sync-id: 7d1b759dffeca9374ecab39f7f031cf0da6832e3
fbshipit-source-id: 7d1b759dffeca9374ecab39f7f031cf0da6832e3
2016-04-14 20:31:28 -07:00
cpojer 1e41587778 Fix babel polyfill integration, add async tests and documentation.
Summary: Closes https://github.com/facebook/jest/pull/767

Differential Revision: D3014818

fb-gh-sync-id: 7da53151ddbe12fb2d9c28ed341503d07617e5cf
shipit-source-id: 7da53151ddbe12fb2d9c28ed341503d07617e5cf
2016-03-04 16:24:56 -08:00
cpojer ecb57957a2 Add babel-jest into the repo
Summary:babel-jest is moving into jest as a package. This allows us to consolidate the codebase. Note that we are only re-using the npm package for babel-jest but the implementation actually changed as the `babel-preset-jest` is now being loaded automatically.

When `babel-jest` is installed in the project that jest is being run on, it will now automatically be loaded. See the `examples/react` folder – the only setup needed for babel to work is to enable the default presets (es2015 and react) and to `npm install babel-jest`. In this PR I also added the `setupFiles` config flag. There isn't really a reason to limit this to a single entry.
Closes https://github.com/facebook/jest/pull/757

Reviewed By: kentaromiura

Differential Revision: D2998065

fb-gh-sync-id: D2998065
shipit-source-id: D2998065
2016-03-01 22:37:04 -08:00
Jeff Carpenter 97950faad4 Typo fix bin -> bind 2016-02-26 17:16:11 -08:00
cpojer 741f4a8de1 Cleanup and update examples in preparation for 0.9.0. 2016-02-25 17:14:18 +09:00
drac bb43b4ed39 fix(react example): correct .babelrc and example
- in order to use 'babel-plugins-*' to parse the syntax, we can use
  'babel-preset-*' packages that we have already installed.
  for using 'babel-preset-*' packages you need to specify it in the
  .babelrc file as "presets".
  (Look here: https://babeljs.io/docs/plugins/#presets)

  otherwise if you want to use 'plugins' and parse the syntax;
  you have to install 'babel-plugin-*' packages.
  (Look here: https://babeljs.io/docs/plugins/)

- 'export default *' changed to 'module.exports = *' due to
  syntax error.
2015-11-17 14:37:00 +02:00
cpojer 410493a001 Add .babelrc to react example. 2015-11-16 13:48:02 -08:00
Matt Berg c16648ce07 Updated dependencies to include jest. 2015-10-23 15:04:01 -06:00
cpojer 2597a0b16e Remove react example and rename the react-es6 example 2015-10-23 11:36:44 -07:00
Chiedo e3b029b8d4 Updated testing docs 2015-10-14 14:51:56 -04:00
Jake Boone 67b2e98a65 Removed React JSX pragma from CheckboxWithLabel-test.js 2015-03-11 09:59:35 -04:00
Jake Boone 28c245a9b4 Removed React JSX pragma from CheckboxWithLabel.js 2015-03-11 09:59:04 -04:00