Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr/6334
Browse files Browse the repository at this point in the history
* upstream/master: (122 commits)
  fix: don't report promises as open handles (jestjs#6716)
  support serializing `DocumentFragment` (jestjs#6705)
  Allow test titles to include array index (jestjs#6414)
  fix `toContain` suggest to contain equal message (jestjs#6810)
  fix: testMatch not working with negations (jestjs#6648)
  Add test cases for jestjs#6744 (jestjs#6772)
  print stack trace on calls to process.exit (jestjs#6714)
  Updates SnapshotTesting.md to provide more info. on snapshot scope (jestjs#6735)
  Mark snapshots as obsolete when moved to an inline snapshot (jestjs#6773)
  [Docs] Clarified the use of literal values as property matchers in toMatchSnapshot() (jestjs#6807)
  Update CHANGELOG.md (jestjs#6799)
  fix changelog entry that is not in 23.4.2 (jestjs#6796)
  Fix --coverage with --findRelatedTests overwriting collectCoverageFrom options (jestjs#6736)
  Update testURL default value from about:blank to localhost (jestjs#6792)
  fix: `matchInlineSnapshot` when prettier dependencies are mocked (jestjs#6776)
  Fix retryTimes and add e2e regression test (jestjs#6762)
  Release v23.4.2
  Docs/ExpectAPI: Correct docs for `objectContaining` (jestjs#6754)
  chore(packages/babel-jest) readme (jestjs#6746)
  docs: noted --coverage aliased by --collectCoverage (jestjs#6741)
  ...
  • Loading branch information
thymikee committed Aug 8, 2018
2 parents 68a822b + 0591f22 commit f671f8e
Show file tree
Hide file tree
Showing 467 changed files with 19,740 additions and 2,550 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"transform-flow-strip-types",
"transform-es2015-destructuring",
"transform-es2015-parameters",
"transform-es2015-shorthand-properties",
"transform-es2015-spread",
"transform-async-to-generator",
"transform-strict-mode",
Expand Down
50 changes: 11 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,10 @@ aliases:
- node_modules
- website/node_modules
key: v2-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }}

- &deploy
command: |
# Deploy Jest website using Docusaurus bot
git config --global user.email "docusaurus-bot@users.noreply.github.com"
git config --global user.name "Website Deployment Script"
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
# install Docusaurus and generate file of English strings
yarn && cd website && yarn write-translations
# crowdin install
sudo apt-get update
sudo apt-get install default-jre rsync
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
sleep 5
# translations upload/download
yarn crowdin-upload
yarn crowdin-download
# build and publish website
GIT_USER=docusaurus-bot USE_SSH=false yarn publish-gh-pages

- &filter-ignore-gh-pages
branches:
ignore: gh-pages

version: 2
jobs:
Expand Down Expand Up @@ -73,21 +57,6 @@ jobs:
- store_test_results:
path: reports/junit

test-node-9:
working_directory: ~/jest
docker:
- image: circleci/node:9
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run:
command: yarn test-ci-partial
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"


test-jest-circus:
working_directory: ~/jest
docker:
Expand Down Expand Up @@ -136,16 +105,19 @@ jobs:
- store_test_results:
path: reports/junit

test-and-deploy-website:
test-or-deploy-website:
working_directory: ~/jest
docker:
- image: circleci/node:8
resource_class: large
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- deploy: *deploy
- run:
name: Test or Deploy Jest Website
command: ./.circleci/website.sh

# Workflows enables us to run multiple jobs in parallel
workflows:
Expand All @@ -156,7 +128,7 @@ workflows:
- test-node-8
- test-node-6
- test-node-10
- test-node-9
- test-jest-circus
- test-browser
- test-and-deploy-website
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
31 changes: 31 additions & 0 deletions .circleci/website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -e

git diff-tree --no-commit-id --name-only -r HEAD > files_changed.txt
if ! grep -E "(^docs\/.*)|(^website\/.*)" files_changed.txt; then
echo "Skipping deploy & test. No relevant website files have changed"
else
echo "Relevant website files have changed"
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then
# configure Docusaurus bot
git config --global user.email "docusaurus-bot@users.noreply.github.com"
git config --global user.name "Website Deployment Script"
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc
# install Docusaurus and generate file of English strings
yarn && cd website && yarn write-translations
# crowdin install
sudo apt-get update
sudo apt-get install default-jre rsync
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
# translations upload/download
yarn crowdin-upload
yarn crowdin-download
# build and publish website
GIT_USER=docusaurus-bot USE_SSH=false yarn publish-gh-pages
else
echo "Skipping deploy. Test website build"
cd website && yarn && yarn build
fi
fi
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
{
files: ['*.md'],
rules: {
'arrow-body-style': 0,
'consistent-return': 0,
'flowtype/require-valid-file-annotation': 0,
'import/no-extraneous-dependencies': 0,
Expand Down Expand Up @@ -61,6 +62,7 @@ module.exports = {
'examples/**/*',
'scripts/**/*',
'e2e/*/**/*',
'website/*.js',
'website/*/**/*',
'eslintImportResolver.js',
],
Expand Down Expand Up @@ -111,6 +113,7 @@ module.exports = {
parser: 'babel-eslint',
plugins: ['markdown', 'import', 'prettier'],
rules: {
'arrow-body-style': 2,
'flowtype/boolean-style': 2,
'flowtype/no-primitive-constructor-types': 2,
'flowtype/require-valid-file-annotation': 2,
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ untyped-import
untyped-type-import

[version]
^0.73.0
^0.75.0
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 👉 [Please follow one of these issue templates](https://github.com/facebook/jest/issues/new/choose) 👈

<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate -->

Note: to keep the backlog clean and actionable, issues may be immediately closed if they do not follow one of the above issue templates.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: 🐛 Bug report
about: Create a report to help us improve
---

<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate -->

## 🐛 Bug Report

A clear and concise description of what the bug is.
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: 🚀 Feature Proposal
about: Submit a proposal for a new feature
---

<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate -->

## 🚀 Feature Proposal

A clear and concise description of what the feature is.
Expand Down
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ name: 💬 Questions / Help
about: If you have questions, please check our Discord or StackOverflow
---

<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate -->

## 💬 Questions and Help

### Please note that this issue tracker is not a help form and this issue will be closed.

For questions or help please see:

- [The Jest help page](https://facebook.github.io/jest/en/help.html)
- [The Jest help page](https://jestjs.io/en/help.html)
- [Our discord channel in Reactiflux](https://discord.gg/MWRhKCj)
- The [jestjs](https://stackoverflow.com/questions/tagged/jestjs) tag on [StackOverflow](https://stackoverflow.com/questions/ask)
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: 💥 Regression Report
about: Report unexpected behavior that worked in previous versions
---

<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate -->

## 💥 Regression Report

A clear and concise description of what the regression is.
Expand Down
2 changes: 2 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jest) or our [discord channel](https://discord.gg/MWRhKCj) for questions.

<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate -->
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
/packages/*/package-lock.json

/website/build
/website/backers.json
/website/node_modules
/website/yarn.lock
/website/translated_docs
/website/i18n/*
!/website/i18n/en.json

coverage
lerna-debug.log
Expand Down
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

114 changes: 109 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,122 @@
## master

### Features

- `[jest-runner]` print stack trace when `process.exit` is called from user code ([#6714](https://github.com/facebook/jest/pull/6714))
- `[jest-each]` introduces `%#` option to add index of the test to its title ([#6414](https://github.com/facebook/jest/pull/6414))
- `[pretty-format]` Support serializing `DocumentFragment` ([#6705](https://github.com/facebook/jest/pull/6705))

### Fixes

- `[jest-snapshot` Mark snapshots as obsolete when moved to an inline snapshot ([#6773](https://github.com/facebook/jest/pull/6773))
- `[jest-config]` Fix `--coverage` with `--findRelatedTests` overwriting `collectCoverageFrom` options ([#6736](https://github.com/facebook/jest/pull/6736))
- `[jest-config]` Update default config for testURL from 'about:blank' to 'http://localhost' to address latest JSDOM security warning. ([#6792](https://github.com/facebook/jest/pull/6792))
- `[jest-cli]` Fix `testMatch` not working with negations ([#6648](https://github.com/facebook/jest/pull/6648))
- `[jest-cli]` Don't report promises as open handles ([#6716](https://github.com/facebook/jest/pull/6716))

## 23.4.2

### Performance

- `[jest-changed-files]` limit git and hg commands to specified roots ([#6732](https://github.com/facebook/jest/pull/6732))

### Fixes

- `[jest-circus]` Fix retryTimes so errors are reset before re-running ([#6762](https://github.com/facebook/jest/pull/6762))
- `[docs]` Update `expect.objectContaining()` description ([#6754](https://github.com/facebook/jest/pull/6754))
- `[babel-jest]` Make `getCacheKey()` take into account `createTransformer` options ([#6699](https://github.com/facebook/jest/pull/6699))
- `[jest-jasmine2]` Use prettier through `require` instead of `localRequire`. Fixes `matchInlineSnapshot` where prettier dependencies like `path` and `fs` are mocked with `jest.mock`. ([#6776](https://github.com/facebook/jest/pull/6776))
- `[docs]` Fix contributors link ([#6711](https://github.com/facebook/jest/pull/6711))
- `[website]` Fix website versions page to link to correct language ([#6734](https://github.com/facebook/jest/pull/6734))
- `[expect]` Update `toContain` suggestion to contain equal message ([#6792](https://github.com/facebook/jest/pull/6810))

## 23.4.1

### Features

- `[jest-cli]` Watch plugins now have access to a broader range of global configuration options in their `updateConfigAndRun` callbacks, so they can provide a wider set of extra features ([#6473](https://github.com/facebook/jest/pull/6473))
- `[jest-snapshot]` `babel-traverse` is now passed to `jest-snapshot` explicitly to avoid unnecessary requires in every test

### Fixes

- `[jest-haste-map]` Optimize watchman crawler by using `glob` on initial query ([#6689](https://github.com/facebook/jest/pull/6689))

## 23.4.0

### Features

- `[jest-haste-map]` Add `computeDependencies` flag to avoid opening files if not needed ([#6667](https://github.com/facebook/jest/pull/6667))
- `[jest-runtime]` Support `require.resolve.paths` ([#6471](https://github.com/facebook/jest/pull/6471))
- `[jest-runtime]` Support `paths` option for `require.resolve` ([#6471](https://github.com/facebook/jest/pull/6471))

### Fixes

- `[jest-runner]` Force parallel runs for watch mode, to avoid TTY freeze ([#6647](https://github.com/facebook/jest/pull/6647))
- `[jest-cli]` properly reprint resolver errors in watch mode ([#6407](https://github.com/facebook/jest/pull/6407))
- `[jest-cli]` Write configuration to stdout when the option was explicitly passed to Jest ([#6447](https://github.com/facebook/jest/pull/6447))
- `[jest-cli]` Fix regression on non-matching suites ([6657](https://github.com/facebook/jest/pull/6657))
- `[jest-runtime]` Roll back `micromatch` version to prevent regression when matching files ([#6661](https://github.com/facebook/jest/pull/6661))

## 23.3.0

### Features

- `[jest-cli]` Allow watch plugin to be configured ([#6603](https://github.com/facebook/jest/pull/6603))
- `[jest-snapshot]` Introduce `toMatchInlineSnapshot` and `toThrowErrorMatchingInlineSnapshot` matchers ([#6380](https://github.com/facebook/jest/pull/6380))

### Fixes

- `[jest-regex-util]` Improve handling already escaped path separators on Windows ([#6523](https://github.com/facebook/jest/pull/6523))
- `[jest-cli]` Fix `testNamePattern` value with interactive snapshots ([#6579](https://github.com/facebook/jest/pull/6579))
- `[jest-cli]` Fix enter to interrupt watch mode ([#6601](https://github.com/facebook/jest/pull/6601))

### Chore & Maintenance

- `[website]` Switch domain to https://jestjs.io ([#6549](https://github.com/facebook/jest/pull/6549))
- `[tests]` Improve stability of `yarn test` on Windows ([#6534](https://github.com/facebook/jest/pull/6534))
- `[*]` Transpile object shorthand into Node 4 compatible syntax ([#6582](https://github.com/facebook/jest/pull/6582))
- `[*]` Update all legacy links to jestjs.io ([#6622](https://github.com/facebook/jest/pull/6622))
- `[docs]` Add docs for 23.1, 23.2, and 23.3 ([#6623](https://github.com/facebook/jest/pull/6623))
- `[website]` Only test/deploy website if relevant files are changed ([#6626](https://github.com/facebook/jest/pull/6626))
- `[docs]` Describe behavior of `resetModules` option when set to `false` ([#6641](https://github.com/facebook/jest/pull/6641))

## 23.2.0

### Features

- `[jest-each]` Add support for keyPaths in test titles ([#6457](https://github.com/facebook/jest/pull/6457))
- `[jest-cli]` Add `jest --init` option that generates a basic configuration file with a short description for each option ([#6442](https://github.com/facebook/jest/pull/6442))
- `[jest.retryTimes]` Add `jest.retryTimes()` option that allows failed tests to be retried n-times when using jest-circus. ([#6498](https://github.com/facebook/jest/pull/6498))

### Fixes

- `[jest-cli]` Add check to make sure one or more tests have run before notifying when using `--notify` ([#6495](https://github.com/facebook/jest/pull/6495))
- `[jest-cli]` Pass `globalConfig` as a parameter to `globalSetup` and `globalTeardown` functions ([#6486](https://github.com/facebook/jest/pull/6486))
- `[jest-config]` Add missing options to the `defaults` object ([#6428](https://github.com/facebook/jest/pull/6428))
- `[expect]` Using symbolic property names in arrays no longer causes the `toEqual` matcher to fail ([#6391](https://github.com/facebook/jest/pull/6391))
- `[expect]` `toEqual` no longer tries to compare non-enumerable symbolic properties, to be consistent with non-symbolic properties. ([#6398](https://github.com/facebook/jest/pull/6398))
- `[jest-util]` `console.timeEnd` now properly log elapsed time in milliseconds. ([#6456](https://github.com/facebook/jest/pull/6456))
- `[jest-mock]` Fix `MockNativeMethods` access in react-native `jest.mock()` ([#6505](https://github.com/facebook/jest/pull/6505))

### Chore & Maintenance

- `[docs]` Add jest-each docs for 1 dimensional arrays ([#6444](https://github.com/facebook/jest/pull/6444/files))

## 23.1.0

### Features

- `[jest-each]` Add pretty-format serialising to each titles ([#6357](https://github.com/facebook/jest/pull/6357))
- `[jest-cli]` shouldRunTestSuite watch hook now receives an object with `config`, `testPath` and `duration` ([#6350](https://github.com/facebook/jest/pull/6350))
- `[jest-each]` Support one dimensional array of data ([#6351](https://github.com/facebook/jest/pull/6351))
- `[jest-watch]` create new package `jest-watch` to ease custom watch plugin development ([#6318](https://github.com/facebook/jest/pull/6318))
- `[jest-circus]` Make hooks in empty describe blocks error ([#6320](https://github.com/facebook/jest/pull/6320))
- Add a config/CLI option `errorOnDeprecated` which makes calling deprecated APIs throw hepful error messages.
- Add a config/CLI option `errorOnDeprecated` which makes calling deprecated APIs throw hepful error messages ([#6339](https://github.com/facebook/jest/pull/6339))

### Fixes

- `[jest-each]` Stop test title concatenating extra args ([##6346](https://github.com/facebook/jest/pull/#6346))
- `[jest-each]` Fix pluralising missing arguments error ([#6369](https://github.com/facebook/jest/pull/6369))
- `[jest-each]` Stop test title concatenating extra args ([#6346](https://github.com/facebook/jest/pull/6346))
- `[expect]` toHaveBeenNthCalledWith/nthCalledWith gives wrong call messages if not matched ([#6340](https://github.com/facebook/jest/pull/6340))
- `[jest-each]` Make sure invalid arguments to `each` points back to the user's code ([#6347](https://github.com/facebook/jest/pull/6347))
- `[expect]` toMatchObject throws TypeError when a source property is null ([#6313](https://github.com/facebook/jest/pull/6313))
Expand Down Expand Up @@ -879,7 +983,7 @@

## jest 18.0.0

See https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html
See https://jestjs.io/blog/2016/12/15/2016-in-jest.html

- The testResultsProcessor function is now required to return the modified results.
- Removed `pit` and `mockImpl`. Use `it` or `mockImplementation` instead.
Expand Down Expand Up @@ -1016,7 +1120,7 @@ See https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html

## jest 15.0.0

- See https://facebook.github.io/jest/blog/2016/09/01/jest-15.html
- See https://jestjs.io/blog/2016/09/01/jest-15.html
- Jest by default now also recognizes files ending in `.spec.js` and `.test.js` as test files.
- Completely replaced most Jasmine matchers with new Jest matchers.
- Rewrote Jest's CLI output for test failures and summaries.
Expand Down Expand Up @@ -1110,7 +1214,7 @@ See https://facebook.github.io/jest/blog/2016/12/15/2016-in-jest.html
- Added `jest-resolve` as a standalone package based on the Facebook module resolution algorithm.
- Added `jest-changed-files` as a standalone package to detect changed files in a git or hg repo.
- Added `--setupTestFrameworkFile` to cli.
- Added support for coverage thresholds. See http://facebook.github.io/jest/docs/api.html#coveragethreshold-object.
- Added support for coverage thresholds. See https://jestjs.io/docs/en/configuration#coveragethreshold-object.
- Updated to jsdom 9.0.
- Updated and improved stack trace reporting.
- Added `module.filename` and removed the invalid `module.__filename` field.
Expand Down

0 comments on commit f671f8e

Please sign in to comment.