Commit Graph

89 Commits

Author SHA1 Message Date
Hannan Ali 5ab8e2826e ESLint support for documentation (#3047)
* add markdown plugin in eslint

* add lint-docs build step

* lint JavaScript file

* final lint-docs command

* lint ExpectAPI

* lint GettingStarted.md

* lint GlobalAPI

* lint GlobalAPI

* lint JestObjectAPI

* lint Webpack.md

* lint UsingMatchers.md in docs

* lint TutorialReactNative.md in docs

* lint TutorialReact.md in docs

* lint docs file

* add lint-docs to test-ci script

* add lint-docs script to test & test-ci

* turn off more rules to lint-docs in package.json

* remove lint-docs from test and test-ci

* add lint-docs to test script in package.json

* remove lint-docs script from circle.yml

* add lint-docs script to test-ci in package.json

* rename js codeblock with json appropriately

* remove unnecessary log files

* remove lint-docs from test-ci

test script already includes lint-docs,
it'll be reduntant to do the same for more than one node versions

* remove error.log file

* use eslintrc-docs.json for overriding

* remove eslint comments from docs

Removing eslint comments from docs and moving them to
top level in .eslintrc-docs.json

* add lint-docs in correct order to test-ci and test
2017-03-04 08:46:48 +00:00
Héctor Ramos 27a8077258 Revamped Jest Docs and Website
New look and feel. Updated all tutorials, docs, guides with latest best practices.

* Cleaned up API Reference docs (#2422)
* Reorganized Sidebar Navigation
* New Introduction Section (#2425)
* Simplified Getting Started introduction
* Break up API Reference into multiple docs, separate from Guides (#2388)
* Support is now Help (#2370)
* Add "Snapshot Testing", "Testing Asynchronous Code" & "Setup and Teardown" docs (#2419, #2406)
* Create Jest user showcase (#2369)
* New blog post announcing refreshed documentation (#2522)
* Truncate blog posts in blog index
* New homepage hero (#2662)
* New mobile nav (#2664)
* Add standard FB Open Source Footer (#2660)
* Add RedirectLayout to prevent broken links (#2700)
* Refreshed Homepage and Colors across site (#2699)
* Deploy Jest website via CircleCI
2017-01-27 09:40:05 -08:00
Mark Pedrotti c32ef8ac39 Docs: add props argument in example code of Tutorial React (#2185) 2016-11-29 16:52:41 +00:00
Frankie Bagnardi fd9be0adc7 typo in require('babel-jest') (#2149) 2016-11-22 09:57:08 +09:00
Zakaria Ridouh de7b510c11 docs: fix incorrect link (#2036)
* ✏️ docs: fix incorrect link

* Update TutorialReact.md
2016-11-01 06:34:41 +00:00
Christoph Pojer fad99ffd9c Transform/preprocessor cleanups; remove old deprecation warnings. (#2022)
* Update tests.

* * More updates to preprocessor -> transform conversion.
* Remove old deprecation warnings.
2016-10-28 15:53:07 +09:00
Keyan Zhang d5b1e0179f Replace `scriptPreprocessor` config with `transform` (#1917)
* Added `transform` and `transformIgnorePatterns` to `jest-config`.

* Let `jest-runtime` use the `transform` config option

* Updated test setup and a snapshot

* Updated typescript example

* Added an unit test for custom css preprocessor

* Integration test using multiple transformers

* Modified `jest-repl` to support `transform`

* Added a warning in `jest-config` and legacy support for scriptPreprocessor

* Modified error message in `jest-runtime`

* Updated documentation

* fixed windows build
2016-10-28 15:07:04 +09:00
cpojer 94238b00a1 Simplify the website + Jest 16 blog post. 2016-10-03 17:21:58 +09:00
Ashton 4d6fb9f45e Use enzyme inside react tutorial's DOM testing section (instead of React's testutils) (#1783)
* Use enzyme inside react tutorial

* Update TutorialReact.md
2016-09-24 12:56:27 +09:00
Jordan Eldredge 0d342ee7a6 Restructure incomplete sentence (#1627) 2016-09-06 16:55:07 -07:00
cpojer 46868fcf1d Website updates. 2016-09-02 20:09:43 +01: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
Pankaj Patel 9b8a26fbdf File name in comment chnaged (#1496)
This would confuse the reader as both code blocks show same file name.
As the test file calls the correct file name but the name is wrong in react component file name, it results in confusion.
2016-08-27 16:09:28 +02:00
Adam e51108ae03 Correct tutorial docs (#1381)
* Stray comma in tutorial docs

* Remove extra npm install.
the docs are reading in such a way that this nam install seems
superfluous.
2016-08-08 06:44:13 -07:00
Kent C. Dodds 4cd27828e8 docs: remove * from version in React Tutorial (#1360)
closes #1357
2016-08-04 09:25:13 +09:00
Christoph Pojer 3282e9abe9 Use react-test-renderer in example code. (#1344) 2016-08-01 18:53:23 +09:00
Christoph Pojer 58ab781f89 Add experimental react-native support. (#1317)
* Add preset option and experimental jest-react-native project.

* Import react-native example.

* Add react-native JS examples.

* Update test runner for the react-native-example.

* Use the mocks provided by react-native.

* Preset updates.

* Skip react-native example on Node 4.

* Update Changelog.

* Add react-native tutorial, update react tutorial, add blog post.
2016-07-27 13:43: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 7f76b42328 Change preprocessorIgnorePathPatterns for better react-native support
Summary:Discussion: https://www.facebook.com/groups/reactnativeoss/permalink/1528961550733807/

I would like `babel-jest` and `jest`'s setup process to be simpler. It turns out that react-native plugin developers commonly ship plugins without precompiling them with babel, leaving it to react native's packager.

This changes the `preprocessorIgnorePathPatterns` config option to default to `['/node_modules/']` or an empty array when react-native is detected as part of the project. Further, I removed the `node_modules` check in babel-jest, because the preprocessor is now not called when the file is a node_module. This has the nice side-effect of *not* copying every single node_module JS file into the cache and the files will now be read from the cache directly! For users of babel-jest, nothing will change. For people using react-native, they'll now be able to use `babel-jest` directly. For people who do not use a preprocessor, this change doesn't have an effect either. It does however change Jest for people who use
Closes https://github.com/facebook/jest/pull/779

Reviewed By: yungsters

Differential Revision: D3025485

fb-gh-sync-id: 56254634383d28cd9952adcfb0081ab9ec4f0fa6
shipit-source-id: 56254634383d28cd9952adcfb0081ab9ec4f0fa6
2016-03-08 16:54:27 -08: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 81d6697617 New documentation and updated website and examples.
Summary:This gets Jest ready for 0.9.0.

What's new?
* Slightly refreshed look, based on the Relay website.
* New summary of what Jest is on the website.
* New Getting Started guide, with babel support and key feature explanation.
* Added a troubleshooting section.
* Updated all examples in the documentation.
* Added all new APIs to the API docs, updated everything to use `jest.fn()` instead of `jest.genMockFn()`.
* Removed the webpack alias and coffeescript guides. Neither of them are really supported or useful at this point. We can bring back a guide later on proper webpack integration if someone in the community takes this on. The webpack-alias feature is handled by the `moduleNameMapper` API.
* Added a link to the `Failed to get metadata` error in Jest.

See http://cpojer.github.io/jest/ for a preview.

In a follow-up I'll add a section on async testing for Promises and some more info about automocking.
Closes https://github.com/facebook/jest/pull/763

Reviewed By: yungsters

Differential Revision: D3005361

fb-gh-sync-id: f8e634cf4a311764f311f8b5849781b53975e686
shipit-source-id: f8e634cf4a311764f311f8b5849781b53975e686
2016-03-03 14:20:34 -08:00
Jeff Carpenter 95be85dcdc Update React Tutorial to match current example
Summary:Supercedes #630
Closes https://github.com/facebook/jest/pull/747

Differential Revision: D2981416

fb-gh-sync-id: 31364d385a9081b13118394fd6d0b8a654648e72
shipit-source-id: 31364d385a9081b13118394fd6d0b8a654648e72
2016-02-25 21:11:58 -08:00
Buddhike de Silva c90543da08 Documented babel presets required to run jest.
Summary: Closes https://github.com/facebook/jest/pull/641

Reviewed By: svcscm

Differential Revision: D2746064

fb-gh-sync-id: 17439a5a5ed304bb78d317e1d02570b7eade64e5
2015-12-10 14:12:49 -08:00
Michael Olson fd33aad1da Add documentation for integrating with Webpack using jest-webpack-alias
Summary: - docs/WebpackIntegration.md: Document this
- docs/GettingStarted.md: Change next link to webpack-integration
Closes https://github.com/facebook/jest/pull/606

Reviewed By: svcscm

Differential Revision: D2647871

fb-gh-sync-id: 45298c36f57c9d6bfe0794da5c414221cf30c206
2015-11-12 11:12:29 -08:00
Christian Lentfort f5cc5d719b Update documentation of the react example.
Summary: Update the documentation of the React example, restructe the text a
bit and add some additional information.

Fixes #568.
Closes https://github.com/facebook/jest/pull/570

Reviewed By: svcscm

Differential Revision: D2576758

fb-gh-sync-id: 452354debcf266f57b39d703895b8d9a7af0fb7b
2015-10-23 14:03:26 -07:00
Christoph Pojer a11ef01382 Import jest docs from open source
Reviewed By: voideanvalue

Differential Revision: D2573262

fb-gh-sync-id: 2cdca4715e9c6cafdfb69f819f05c9518d270af8
2015-10-23 11:11:35 -07:00
cpojer 73ccfff402 Remove docs so the FB sync will work again. 2015-10-23 11:11:01 -07:00
Chiedo e3b029b8d4 Updated testing docs 2015-10-14 14:51:56 -04:00
Blaine Kasten af7a005dc7 Update TutorialReact.md 2015-08-12 13:28:13 -05:00
Blaine Kasten 9fb897b805 Update TutorialReact.md 2015-06-26 09:36:50 -05:00
Zach b1f9ac1d7a updated with React.findDOMNode 2015-05-27 15:06:08 -07:00
Jake Boone 5a06d3bece Remove JSX pragma from TutorialReact.js 2015-03-12 10:27:38 -04:00
drabinowitz 26bd362294 Minor docs typo for React Tutorial Setup 2014-12-22 19:51:16 -05:00
xeodou f52aae2b7c Fix tutorial react example, put JSX pragma at the top. 2014-09-21 17:55:37 +08:00
Ben Alpert db003d5dc7 Fix React example for new descriptor world 2014-07-16 18:29:56 -07:00
Christopher Chedeau efc1b79a9d Remove default value for testPathIgnorePatterns in the React example and docs 2014-05-21 12:17:54 -07:00
jeffmo 88a94d5d1b FIRST! 2014-05-14 09:42:01 -07:00