Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into runtime-require-r…
Browse files Browse the repository at this point in the history
…esolve-outside

* upstream/master: (106 commits)
  docs: fix jest-diff example (jestjs#10067)
  Cleanup `displayName` type (jestjs#10049)
  docs: correct confusing filename in `enableAutomock` example (jestjs#10055)
  chore: minor optimize getTransformer (jestjs#10050)
  chore: fix TestUtils.ts to match the types (jestjs#10034)
  Minor test name typo fix (jestjs#10033)
  chore: upgrade to typescript 3.9 (jestjs#10031)
  feat: CLI argument to filter tests by projects (jestjs#8612)
  chore: bump `istanbul-lib-instrument` (jestjs#10009)
  feat: support config files exporting (`async`) `function`s (jestjs#10001)
  fix: add missing haste-map dep to jest-snapshot (jestjs#10008)
  🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉 (jestjs#10000)
  Fix typo in dependency warning (jestjs#10006)
  chore: add missing comma (jestjs#9999)
  fix: Control no diff message color with diff options (jestjs#9997)
  fix(jest-jasmine2): fix Error message (jestjs#9990)
  docs: fix jest-object ids for docusaurs (jestjs#9994)
  docs: fix Configuration, JestPlatform and JestObjectAPI docs for 26 (jestjs#9985)
  Add migration notes for breaking changes (jestjs#9978)
  chore: fix date and heading in blog post (jestjs#9977)
  ...
  • Loading branch information
jeysal committed May 25, 2020
2 parents c357cea + 81712ba commit 0b3e556
Show file tree
Hide file tree
Showing 374 changed files with 6,312 additions and 4,938 deletions.
31 changes: 1 addition & 30 deletions .circleci/config.yml
Expand Up @@ -18,22 +18,6 @@ aliases:

version: 2
jobs:
test-node-8:
working_directory: ~/jest
docker:
- image: circleci/node:8
steps:
- checkout
- run:
command: yarn remove-prettier-dep
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run:
command: yarn test-ci-partial
- store_test_results:
path: reports/junit

test-node-10:
working_directory: ~/jest
docker:
Expand All @@ -58,7 +42,7 @@ jobs:
- run: *install
- save-cache: *save-cache
- run:
command: JEST_CIRCUS=1 yarn test-ci-partial
command: JEST_CIRCUS=1 yarn test-ci-partial && JEST_CIRCUS=1 yarn test-leak
- store_test_results:
path: reports/junit

Expand Down Expand Up @@ -104,17 +88,6 @@ jobs:
- store_test_results:
path: reports/junit

test-browser:
working_directory: ~/jest
docker:
- image: circleci/node:12-browsers
steps:
- checkout
- restore-cache: *restore-cache
- run: *install
- save-cache: *save-cache
- run: yarn test-ci-es5-build-in-browser

test-or-deploy-website:
working_directory: ~/jest
docker:
Expand All @@ -134,12 +107,10 @@ workflows:
version: 2
build-and-deploy:
jobs:
- test-node-8
- test-node-10
- test-node-12
- test-node-13
- test-node-14 # current
- test-jest-circus
- test-browser
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
1 change: 0 additions & 1 deletion .eslintignore
Expand Up @@ -3,7 +3,6 @@
bin/
flow-typed/**
packages/*/build/**
packages/*/build-es5/**
packages/jest-diff/src/cleanupSemantic.ts
website/blog
website/build
Expand Down
9 changes: 8 additions & 1 deletion .eslintrc.js
Expand Up @@ -26,6 +26,7 @@ module.exports = {
'error',
{argsIgnorePattern: '^_'},
],
'@typescript-eslint/prefer-ts-expect-error': 'error',
// Since we do `export =`. Remove for Jest 25
'import/default': 'off',
'import/order': 'error',
Expand Down Expand Up @@ -95,7 +96,6 @@ module.exports = {
files: [
'packages/jest-jasmine2/src/jasmine/**/*',
'packages/expect/src/jasmineUtils.ts',
'e2e/browser-support/browserTest.js',
'**/vendor/**/*',
],
rules: {
Expand Down Expand Up @@ -142,6 +142,13 @@ module.exports = {
// https://github.com/benmosher/eslint-plugin-import/issues/645
'import/order': 0,
'no-console': 0,
'no-restricted-imports': [
2,
{
message: 'Please use graceful-fs instead.',
name: 'fs',
},
],
'no-unused-vars': 2,
'prettier/prettier': 2,
'sort-imports': [2, {ignoreDeclarationSort: true}],
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/nodejs.yml
Expand Up @@ -41,12 +41,10 @@ jobs:
run: node scripts/build.js
- name: run tsc
run: yarn build:ts
- name: verify ts 3.4 compatibility
- name: verify TypeScript@3.8 compatibility
run: yarn verify-old-ts
- name: run eslint
run: yarn lint
- name: run eslint on browser builds
run: yarn lint-es5-build
- name: run prettier
run: yarn lint:prettier:ci
- name: check copyright headers
Expand All @@ -56,8 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# https://github.com/actions/setup-node/issues/27
node-version: [8.17.0, 10.x, 12.x, 13.x, 14.x]
node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}

Expand All @@ -82,9 +79,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: remove prettier dep
run: yarn remove-prettier-dep
if: matrix.node-version == '8.17.0'
- name: install
run: yarn install-no-ts-build
- name: run tests
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -17,7 +17,6 @@
/node_modules

/packages/*/build/
/packages/*/build-es5/
/packages/*/coverage/
/packages/*/node_modules/
/packages/*/package-lock.json
Expand Down
103 changes: 99 additions & 4 deletions CHANGELOG.md
Expand Up @@ -2,13 +2,107 @@

### Features

- `[jest-config]` Support config files exporting (`async`) `function`s ([#10001](https://github.com/facebook/jest/pull/10001))
- `[jest-cli, jest-core]` Add `--selectProjects` CLI argument to filter test suites by project name ([#8612](https://github.com/facebook/jest/pull/8612))

### Fixes

- `[jest-jasmine2]` Stop adding `:` after an error that has no message ([#9990](https://github.com/facebook/jest/pull/9990))
- `[jest-diff]` Control no diff message color with `commonColor` in diff options ([#9997](https://github.com/facebook/jest/pull/9997))
- `[jest-snapshot]` Fix TypeScript compilation ([#10008](https://github.com/facebook/jest/pull/10008))

### Chore & Maintenance

- `[docs]` Correct confusing filename in `enableAutomock` example ([#10055](https://github.com/facebook/jest/pull/10055))
- `[jest-core]` 🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉 ([#10000](https://github.com/facebook/jest/pull/10000))
- `[jest-core, jest-reporters, jest-test-result, jest-types]` Cleanup `displayName` type ([#10049](https://github.com/facebook/jest/pull/10049))

### Performance

## 26.0.1

### Fixes

- `[jest-circus]` Backward compatibility for deprecated `DescribeBlock.tests` to not break e.g. Detox reporter

## 26.0.0

### Features

- `[jest-environment-jsdom]` [**BREAKING**] Upgrade `jsdom` to v16 ([#9606](https://github.com/facebook/jest/pull/9606))
- `[@jest/fake-timers]` Add possibility to use a modern implementation of fake timers, backed by `@sinonjs/fake-timers` ([#7776](https://github.com/facebook/jest/pull/7776))
- `[jest-runtime]` Add `createMockFromModule` as an alias for `genMockFromModule` ([#9962](https://github.com/facebook/jest/pull/9962))

### Fixes

- `[babel-jest]` Handle `null` being passed to `createTransformer` ([#9955](https://github.com/facebook/jest/pull/9955))
- `[jest-circus, jest-console, jest-jasmine2, jest-reporters, jest-util, pretty-format]` Fix time durating formatting and consolidate time formatting code ([#9765](https://github.com/facebook/jest/pull/9765))
- `[jest-circus]` [**BREAKING**] Fail tests if a test takes a done callback and have return values ([#9129](https://github.com/facebook/jest/pull/9129))
- `[jest-circus]` [**BREAKING**] Throw a proper error if a test / hook is defined asynchronously ([#8096](https://github.com/facebook/jest/pull/8096))
- `[jest-circus]` Throw more descriptive error if hook is defined inside test ([#9957](https://github.com/facebook/jest/pull/9957))
- `[jest-circus]` [**BREAKING**] Align execution order of tests to match `jasmine`'s top to bottom order ([#9965](https://github.com/facebook/jest/pull/9965))
- `[jest-config, jest-resolve]` [**BREAKING**] Remove support for `browser` field ([#9943](https://github.com/facebook/jest/pull/9943))
- `[jest-haste-map]` Stop reporting files as changed when they are only accessed ([#7347](https://github.com/facebook/jest/pull/7347))
- `[jest-resolve]` Show relative path from root dir for `module not found` errors ([#9963](https://github.com/facebook/jest/pull/9963))
- `[jest-runtime]` Fix absolute path moduleNameMapper + jest.mock bug ([#8727](https://github.com/facebook/jest/pull/8727))

### Chore & Maintenance

- `[*]` [**BREAKING**] TypeScript definitions requires a minimum of TypeScript v3.8 ([#9823](https://github.com/facebook/jest/pull/9823))
- `[*]` [**BREAKING**] Drop support for Node 8 ([#9423](https://github.com/facebook/jest/pull/9423))
- `[*]` Upgrade to chalk@4 ([#9752](https://github.com/facebook/jest/pull/9752))
- `[*]` Remove usage of `realpath-native` ([#9952](https://github.com/facebook/jest/pull/9952))
- `[docs]` Fix example reference implementation to use Jest with Phabricator ([#8662](https://github.com/facebook/jest/pull/8662))
- `[docs]` Added default compiler to tranform ([#8583](https://github.com/facebook/jest/pull/8583))
- `[docs]` Updated Testing Frameworks guide with React; make it generic ([#9106](https://github.com/facebook/jest/pull/9106))
- `[expect, jest-mock, pretty-format]` [**BREAKING**] Remove `build-es5` from package ([#9945](https://github.com/facebook/jest/pull/9945))
- `[@jest/fake-timers, @jest/environment]` [**BREAKING**] Rename `LolexFakeTimers` to `ModernFakeTimers` ([#9960](https://github.com/facebook/jest/pull/9960))
- `[jest-haste-map]` [**BREAKING**] removed `providesModuleNodeModules` ([#8535](https://github.com/facebook/jest/pull/8535))
- `[jest-runtime]` [**BREAKING**] Remove long-deprecated `require.requireActual` and `require.requireMock` methods ([#9854](https://github.com/facebook/jest/pull/9854))

## 25.5.4

### Fixes

- `[jest-jasmine2]` Don't run `beforeAll` / `afterAll` in skipped describe blocks ([#9931](https://github.com/facebook/jest/pull/9931))

### Chore & Maintenance

- `[jest-runtime]` Do not warn when mutating `require.cache` ([#9946](https://github.com/facebook/jest/pull/9946))

## 25.5.3

### Chore & Maintenance

- `[jest-circus]` Fix memory leak when running in band ([#9934](https://github.com/facebook/jest/pull/9934))

## 25.5.2

### Fixes

- `[jest-globals]` Export globals as values, not types ([#9925](https://github.com/facebook/jest/pull/9925))

## 25.5.1

### Fixes

- `[jest-haste-map]` Add missing `@types/graceful-fs` dependency ([#9913](https://github.com/facebook/jest/pull/9913))
- `[jest-runner]` Correctly serialize `Set` passed to worker ([#9915](https://github.com/facebook/jest/pull/9915))
- `[jest-runtime]` Vary ESM cache by query ([#9914](https://github.com/facebook/jest/pull/9914))

## 25.5.0

### Features

- `[@jest/globals]` New package so Jest's globals can be explicitly imported ([#9801](https://github.com/facebook/jest/pull/9801))
- `[jest-core]` Show coverage of sources related to tests in changed files ([#9769](https://github.com/facebook/jest/pull/9769))
- `[jest-runtime]` Populate `require.cache` ([#9841](https://github.com/facebook/jest/pull/9841))

### Fixes

- `[*]` Use `graceful-fs` directly in every package instead of relying on `fs` being monkey patched ([#9443](https://github.com/facebook/jest/pull/9443))
- `[expect]` Prints the Symbol name into the error message with a custom asymmetric matcher ([#9888](https://github.com/facebook/jest/pull/9888))
- `[jest-circus, jest-jasmine2]` Support older version of `jest-runtime` ([#9903](https://github.com/facebook/jest/pull/9903) & [#9842](https://github.com/facebook/jest/pull/9842))
- `[@jest/environment]` Make sure not to reference Jest types ([#9875](https://github.com/facebook/jest/pull/9875))
- `[jest-message-util]` Code frame printing should respect `--noStackTrace` flag ([#9866](https://github.com/facebook/jest/pull/9866))
- `[jest-runtime]` Support importing CJS from ESM using `import` statements ([#9850](https://github.com/facebook/jest/pull/9850))
Expand All @@ -17,10 +111,15 @@

### Chore & Maintenance

- `[docs]` Add an example for mocking non-default export class

### Performance

- `[jest-resolve]` Update `resolve` to a version using native `realpath`, which is faster than the default JS implementation ([#9872](https://github.com/facebook/jest/pull/9872))
- `[jest-resolve]` Pass custom cached `realpath` function to `resolve` ([#9873](https://github.com/facebook/jest/pull/9873))
- `[jest-runtime]` Add `teardown` method to clear any caches when tests complete ([#9906](https://github.com/facebook/jest/pull/9906))
- `[jest-runtime]` Do not pass files required internally through transformation when loading them ([#9900](https://github.com/facebook/jest/pull/9900))
- `[jest-runtime]` Use `Map`s instead of object literals as cache holders ([#9901](https://github.com/facebook/jest/pull/9901))

## 25.4.0

Expand All @@ -41,8 +140,6 @@
- `[*]` Do not generate TypeScript declaration source maps ([#9822](https://github.com/facebook/jest/pull/9822))
- `[*]` Transpile code for Node 8.3, not 8.0 ([#9827](https://github.com/facebook/jest/pull/9827))

### Performance

## 25.3.0

### Features
Expand Down Expand Up @@ -272,8 +369,6 @@
- `[jest-types]` Mark `InitialOptions` as `Partial` ([#8848](https://github.com/facebook/jest/pull/8848))
- `[jest-config]` Refactor `normalize` to be more type safe ([#8848](https://github.com/facebook/jest/pull/8848))

### Performance

## 24.9.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -117,7 +117,7 @@ PASS __tests__/clear_cache.test.js
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.232s, estimated 1s
Time: 0.232 s, estimated 1 s
Ran all test suites.
```

Expand Down
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -207,8 +207,10 @@ Learn more about using [Jest on the official site!](https://jestjs.io)

Show the world you're using _Jest_ `` [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)

<!-- prettier-ignore -->
```md
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)
```

## Contributing
Expand Down

0 comments on commit 0b3e556

Please sign in to comment.