Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Jest upgrade #3

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0652bdb
Add flow types to Maps in ReactNativeViewConfigRegistry.js (#26064)
sammy-SC Jan 27, 2023
cb16201
Update danger.js token (#26066)
kassens Jan 27, 2023
78c4bec
[DevTools] fix local build for extension (#26067)
mondaychen Jan 27, 2023
ce09ace
Improve Error Messages when Access Client References (#26059)
sebmarkbage Jan 28, 2023
b0671f9
Include removal of scheduler/tracing in changelog (#26063)
eps1lon Jan 30, 2023
9b1423c
Revert "Hold host functions in var" (#26079)
sammy-SC Jan 30, 2023
48b687f
[trusted types][www] Add enableTrustedTypesIntegration flag back in (…
onionymous Jan 30, 2023
1f5ce59
[cleanup] fully roll out warnAboutSpreadingKeyToJSX (#26080)
kassens Jan 30, 2023
6b30832
Upgrade prettier (#26081)
kassens Jan 31, 2023
d7bb524
[cleanup] Remove unused package jest-mock-scheduler (#26084)
ymqy Jan 31, 2023
8b9ac81
Remove unused dependency 'abort-controller' (#26074)
ymqy Jan 31, 2023
977bccd
Refactor Flight Encoding (#26082)
sebmarkbage Jan 31, 2023
8c234c0
Move the Webpack manifest config to one level deeper (#26083)
sebmarkbage Feb 1, 2023
0ba4698
Fix async test in React reconciler (#26087)
ymqy Feb 1, 2023
9d111ff
Serialize Promises through Flight (#26086)
sebmarkbage Feb 1, 2023
922dd7b
Revert the outer module object to an object (#26093)
sebmarkbage Feb 2, 2023
2ef2414
[flow] upgrade to 0.199.0 (#26096)
kassens Feb 2, 2023
855b77c
publish-prereleases: Exit if CircleCI request fails (#26100)
acdlite Feb 3, 2023
4bf2113
Revert "Move the Webpack manifest config to one level deeper (#26083)…
sebmarkbage Feb 6, 2023
03a2160
Rename "dom" fork to "dom-node" and "bun" fork to "dom-bun" (#26117)
sebmarkbage Feb 6, 2023
1445acf
[CI] cache yarn instead of node_modules (#25834)
kassens Feb 6, 2023
c12194f
[DevTools] improve error handling in extension (#26068)
mondaychen Feb 7, 2023
13f4ccf
Fix main (#26120)
eps1lon Feb 7, 2023
f0cf832
Update Flight Fixture to "use client" instead of .client.js (#26118)
sebmarkbage Feb 7, 2023
01a0c4e
Add Edge Server Builds for workerd / edge-light (#26116)
sebmarkbage Feb 7, 2023
758fc7f
Support highlights for React Native apps in dev tools (#26060)
ryancat Feb 7, 2023
a3152ed
support ReactDOM.render(..., document) without crashing (#26129)
gnoff Feb 8, 2023
78d2e9e
Replace DevTools `semver` usages with `compare-versions` for smaller …
markerikson Feb 9, 2023
3ff1540
Prefer JSX in ReactNoop assertions (to combat out-of-memory test runs…
eps1lon Feb 9, 2023
28fcae0
Add support for SVG `transformOrigin` prop (#26130)
arav-ind Feb 9, 2023
5940934
Update to Jest 29 (#26088)
ymqy Feb 9, 2023
c0b0b3a
Only restore Yarn caches on exact key hits (#26133)
eps1lon Feb 9, 2023
53b1f69
Implement unstable_getBoundingClientRect in RN Fabric refs (#26137)
rubennorte Feb 9, 2023
6ddcbd4
[flow] enable LTI inference mode (#26104)
kassens Feb 9, 2023
3569831
Update jest escapeString config (#26140)
ymqy Feb 9, 2023
6c75d4e
Delete blocks fixture (#26143)
sebmarkbage Feb 9, 2023
ef9f6e7
Enable passing Server References from Server to Client (#26124)
sebmarkbage Feb 10, 2023
6396b66
Model Float on Hoistables semantics (#26106)
gnoff Feb 10, 2023
55542bc
Update jest printBasicPrototype config (#26142)
ymqy Feb 10, 2023
c851022
Treat displayName as undefined (#26148)
sebmarkbage Feb 10, 2023
d9e0485
Bypass packages that are already published when confirmed by users (#…
ryancat Feb 10, 2023
b8ae89f
Fix and update attribute-behavior fixture (#26114)
eps1lon Feb 10, 2023
71cace4
Migrate testRunner from jasmine2 to jest-circus (#26144)
ymqy Feb 10, 2023
77841df
Bump jest version
kassens Feb 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
200 changes: 67 additions & 133 deletions .circleci/config.yml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ module.exports = {
es6: true,
node: true,
jest: true,
jasmine: true,
},

globals: {
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = {
jsxBracketSameLine: true,
trailingComma: 'es5',
printWidth: 80,
parser: 'babel',

parser: 'flow',
arrowParens: 'avoid',
overrides: [
{
files: esNextPaths,
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ The existing `renderToString` method keeps working but is discouraged.
* **Layout Effects with Suspense**: When a tree re-suspends and reverts to a fallback, React will now clean up layout effects, and then re-create them when the content inside the boundary is shown again. This fixes an issue which prevented component libraries from correctly measuring layout when used with Suspense.
* **New JS Environment Requirements**: React now depends on modern browsers features including `Promise`, `Symbol`, and `Object.assign`. If you support older browsers and devices such as Internet Explorer which do not provide modern browser features natively or have non-compliant implementations, consider including a global polyfill in your bundled application.

### Scheduler (Experimental)

* Remove unstable `scheduler/tracing` API

## Notable Changes

### React
Expand Down Expand Up @@ -193,6 +197,10 @@ The existing `renderToString` method keeps working but is discouraged.
* Fix a mistake in the Node loader. ([#22537](https://github.com/facebook/react/pull/22537) by [@btea](https://github.com/btea))
* Use `globalThis` instead of `window` for edge environments. ([#22777](https://github.com/facebook/react/pull/22777) by [@huozhi](https://github.com/huozhi))

### Scheduler (Experimental)

* Remove unstable `scheduler/tracing` API ([#20037](https://github.com/facebook/react/pull/20037) by [@bvaughn](https://github.com/bvaughn))

## 17.0.2 (March 22, 2021)

### React DOM
Expand Down
7 changes: 4 additions & 3 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function row(result, baseSha, headSha) {
return rowArr.join(' | ');
}

(async function() {
(async function () {
// Use git locally to grab the commit which represents the place
// where the branches differ

Expand Down Expand Up @@ -241,8 +241,9 @@ Comparing: ${baseSha}...${headSha}

## Critical size changes

Includes critical production bundles, as well as any change greater than ${CRITICAL_THRESHOLD *
100}%:
Includes critical production bundles, as well as any change greater than ${
CRITICAL_THRESHOLD * 100
}%:

${header}
${criticalResults.join('\n')}
Expand Down
111 changes: 93 additions & 18 deletions fixtures/attribute-behavior/AttributeTableSnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@
| `colSpan=(null)`| (initial, ssr error, ssr mismatch)| `<number: 1>` |
| `colSpan=(undefined)`| (initial, ssr error, ssr mismatch)| `<number: 1>` |

## `content` (on `<meta>` inside `<div>`)
## `content` (on `<meta>` inside `<head>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `content=(string)`| (changed)| `"a string"` |
Expand Down Expand Up @@ -5123,7 +5123,7 @@
| `htmlFor=(null)`| (initial)| `<empty string>` |
| `htmlFor=(undefined)`| (initial)| `<empty string>` |

## `http-equiv` (on `<meta>` inside `<div>`)
## `http-equiv` (on `<meta>` inside `<head>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `http-equiv=(string)`| (changed, warning)| `"a string"` |
Expand All @@ -5148,7 +5148,7 @@
| `http-equiv=(null)`| (initial, warning)| `<empty string>` |
| `http-equiv=(undefined)`| (initial, warning)| `<empty string>` |

## `httpEquiv` (on `<meta>` inside `<div>`)
## `httpEquiv` (on `<meta>` inside `<head>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `httpEquiv=(string)`| (changed)| `"a string"` |
Expand Down Expand Up @@ -6198,6 +6198,31 @@
| `lang=(null)`| (initial)| `<empty string>` |
| `lang=(undefined)`| (initial)| `<empty string>` |

## `lang` (on `<html>` inside `<document>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `lang=(string)`| (changed, ssr mismatch)| `"a string"` |
| `lang=(empty string)`| (initial)| `<empty string>` |
| `lang=(array with string)`| (changed, ssr mismatch)| `"string"` |
| `lang=(empty array)`| (initial)| `<empty string>` |
| `lang=(object)`| (changed, ssr mismatch)| `"result of toString()"` |
| `lang=(numeric string)`| (changed, ssr mismatch)| `"42"` |
| `lang=(-1)`| (changed, ssr mismatch)| `"-1"` |
| `lang=(0)`| (changed, ssr mismatch)| `"0"` |
| `lang=(integer)`| (changed, ssr mismatch)| `"1"` |
| `lang=(NaN)`| (changed, warning, ssr mismatch)| `"NaN"` |
| `lang=(float)`| (changed, ssr mismatch)| `"99.99"` |
| `lang=(true)`| (initial, warning)| `<empty string>` |
| `lang=(false)`| (initial, warning)| `<empty string>` |
| `lang=(string 'true')`| (changed, ssr mismatch)| `"true"` |
| `lang=(string 'false')`| (changed, ssr mismatch)| `"false"` |
| `lang=(string 'on')`| (changed, ssr mismatch)| `"on"` |
| `lang=(string 'off')`| (changed, ssr mismatch)| `"off"` |
| `lang=(symbol)`| (initial, warning)| `<empty string>` |
| `lang=(function)`| (initial, warning)| `<empty string>` |
| `lang=(null)`| (initial)| `<empty string>` |
| `lang=(undefined)`| (initial)| `<empty string>` |

## `length` (on `<div>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
Expand Down Expand Up @@ -11373,6 +11398,56 @@
| `transform=(null)`| (initial)| `[]` |
| `transform=(undefined)`| (initial)| `[]` |

## `transform-origin` (on `<svg>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `transform-origin=(string)`| (changed, warning)| `"a string"` |
| `transform-origin=(empty string)`| (changed, warning)| `<empty string>` |
| `transform-origin=(array with string)`| (changed, warning)| `"string"` |
| `transform-origin=(empty array)`| (changed, warning)| `<empty string>` |
| `transform-origin=(object)`| (changed, warning)| `"result of toString()"` |
| `transform-origin=(numeric string)`| (changed, warning)| `"42"` |
| `transform-origin=(-1)`| (changed, warning)| `"-1"` |
| `transform-origin=(0)`| (changed, warning)| `"0"` |
| `transform-origin=(integer)`| (changed, warning)| `"1"` |
| `transform-origin=(NaN)`| (changed, warning)| `"NaN"` |
| `transform-origin=(float)`| (changed, warning)| `"99.99"` |
| `transform-origin=(true)`| (initial, warning)| `<null>` |
| `transform-origin=(false)`| (initial, warning)| `<null>` |
| `transform-origin=(string 'true')`| (changed, warning)| `"true"` |
| `transform-origin=(string 'false')`| (changed, warning)| `"false"` |
| `transform-origin=(string 'on')`| (changed, warning)| `"on"` |
| `transform-origin=(string 'off')`| (changed, warning)| `"off"` |
| `transform-origin=(symbol)`| (initial, warning)| `<null>` |
| `transform-origin=(function)`| (initial, warning)| `<null>` |
| `transform-origin=(null)`| (initial, warning)| `<null>` |
| `transform-origin=(undefined)`| (initial, warning)| `<null>` |

## `transformOrigin` (on `<svg>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `transformOrigin=(string)`| (changed)| `"a string"` |
| `transformOrigin=(empty string)`| (changed)| `<empty string>` |
| `transformOrigin=(array with string)`| (changed)| `"string"` |
| `transformOrigin=(empty array)`| (changed)| `<empty string>` |
| `transformOrigin=(object)`| (changed)| `"result of toString()"` |
| `transformOrigin=(numeric string)`| (changed)| `"42"` |
| `transformOrigin=(-1)`| (changed)| `"-1"` |
| `transformOrigin=(0)`| (changed)| `"0"` |
| `transformOrigin=(integer)`| (changed)| `"1"` |
| `transformOrigin=(NaN)`| (changed, warning)| `"NaN"` |
| `transformOrigin=(float)`| (changed)| `"99.99"` |
| `transformOrigin=(true)`| (initial, warning)| `<null>` |
| `transformOrigin=(false)`| (initial, warning)| `<null>` |
| `transformOrigin=(string 'true')`| (changed)| `"true"` |
| `transformOrigin=(string 'false')`| (changed)| `"false"` |
| `transformOrigin=(string 'on')`| (changed)| `"on"` |
| `transformOrigin=(string 'off')`| (changed)| `"off"` |
| `transformOrigin=(symbol)`| (initial, warning)| `<null>` |
| `transformOrigin=(function)`| (initial, warning)| `<null>` |
| `transformOrigin=(null)`| (initial)| `<null>` |
| `transformOrigin=(undefined)`| (initial)| `<null>` |

## `type` (on `<button>` inside `<div>`)
| Test Case | Flags | Result |
| --- | --- | --- |
Expand Down Expand Up @@ -12476,23 +12551,23 @@
## `viewTarget` (on `<view>` inside `<svg>`)
| Test Case | Flags | Result |
| --- | --- | --- |
| `viewTarget=(string)`| (changed, ssr mismatch)| `"a string"` |
| `viewTarget=(empty string)`| (changed, ssr mismatch)| `<empty string>` |
| `viewTarget=(array with string)`| (changed, ssr mismatch)| `"string"` |
| `viewTarget=(empty array)`| (changed, ssr mismatch)| `<empty string>` |
| `viewTarget=(object)`| (changed, ssr mismatch)| `"result of toString()"` |
| `viewTarget=(numeric string)`| (changed, ssr mismatch)| `"42"` |
| `viewTarget=(-1)`| (changed, ssr mismatch)| `"-1"` |
| `viewTarget=(0)`| (changed, ssr mismatch)| `"0"` |
| `viewTarget=(integer)`| (changed, ssr mismatch)| `"1"` |
| `viewTarget=(NaN)`| (changed, warning, ssr mismatch)| `"NaN"` |
| `viewTarget=(float)`| (changed, ssr mismatch)| `"99.99"` |
| `viewTarget=(string)`| (changed)| `"a string"` |
| `viewTarget=(empty string)`| (changed)| `<empty string>` |
| `viewTarget=(array with string)`| (changed)| `"string"` |
| `viewTarget=(empty array)`| (changed)| `<empty string>` |
| `viewTarget=(object)`| (changed)| `"result of toString()"` |
| `viewTarget=(numeric string)`| (changed)| `"42"` |
| `viewTarget=(-1)`| (changed)| `"-1"` |
| `viewTarget=(0)`| (changed)| `"0"` |
| `viewTarget=(integer)`| (changed)| `"1"` |
| `viewTarget=(NaN)`| (changed, warning)| `"NaN"` |
| `viewTarget=(float)`| (changed)| `"99.99"` |
| `viewTarget=(true)`| (initial, warning)| `<null>` |
| `viewTarget=(false)`| (initial, warning)| `<null>` |
| `viewTarget=(string 'true')`| (changed, ssr mismatch)| `"true"` |
| `viewTarget=(string 'false')`| (changed, ssr mismatch)| `"false"` |
| `viewTarget=(string 'on')`| (changed, ssr mismatch)| `"on"` |
| `viewTarget=(string 'off')`| (changed, ssr mismatch)| `"off"` |
| `viewTarget=(string 'true')`| (changed)| `"true"` |
| `viewTarget=(string 'false')`| (changed)| `"false"` |
| `viewTarget=(string 'on')`| (changed)| `"on"` |
| `viewTarget=(string 'off')`| (changed)| `"off"` |
| `viewTarget=(symbol)`| (initial, warning)| `<null>` |
| `viewTarget=(function)`| (initial, warning)| `<null>` |
| `viewTarget=(null)`| (initial)| `<null>` |
Expand Down
19 changes: 14 additions & 5 deletions fixtures/attribute-behavior/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ function getRenderedAttributeValue(
return document.createElementNS('http://www.w3.org/2000/svg', 'svg');
} else if (containerTagName === 'document') {
return document.implementation.createHTMLDocument('');
} else if (containerTagName === 'head') {
return document.implementation.createHTMLDocument('').head;
} else {
return document.createElement(containerTagName);
}
Expand Down Expand Up @@ -282,12 +284,12 @@ function getRenderedAttributeValue(
try {
let container = createContainer();
renderer.render(react.createElement(tagName, baseProps), container);
defaultValue = read(container.firstChild);
defaultValue = read(container.lastChild);
canonicalDefaultValue = getCanonicalizedValue(defaultValue);

container = createContainer();
renderer.render(react.createElement(tagName, props), container);
result = read(container.firstChild);
result = read(container.lastChild);
canonicalResult = getCanonicalizedValue(result);
didWarn = _didWarn;
didError = false;
Expand All @@ -308,6 +310,12 @@ function getRenderedAttributeValue(
);
container = createContainer();
container.innerHTML = html;
} else if (containerTagName === 'head') {
const html = serverRenderer.renderToString(
react.createElement(tagName, props)
);
container = createContainer();
container.innerHTML = html;
} else {
const html = serverRenderer.renderToString(
react.createElement(
Expand Down Expand Up @@ -764,7 +772,7 @@ class App extends React.Component {
ReactDOMStable:
'https://unpkg.com/react-dom@latest/umd/react-dom.development.js',
ReactDOMServerStable:
'https://unpkg.com/react-dom@latest/umd/react-dom-server.browser.development.js',
'https://unpkg.com/react-dom@latest/umd/react-dom-server-legacy.browser.development.js',
ReactNext: '/react.development.js',
ReactDOMNext: '/react-dom.development.js',
ReactDOMServerNext: '/react-dom-server-legacy.browser.development.js',
Expand Down Expand Up @@ -902,8 +910,9 @@ class App extends React.Component {

let log = '';
for (let attribute of attributes) {
log += `## \`${attribute.name}\` (on \`<${attribute.tagName ||
'div'}>\` inside \`<${attribute.containerTagName || 'div'}>\`)\n`;
log += `## \`${attribute.name}\` (on \`<${
attribute.tagName || 'div'
}>\` inside \`<${attribute.containerTagName || 'div'}>\`)\n`;
log += '| Test Case | Flags | Result |\n';
log += '| --- | --- | --- |\n';

Expand Down
22 changes: 19 additions & 3 deletions fixtures/attribute-behavior/src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ const attributes = [
},
{name: 'cols', tagName: 'textarea'},
{name: 'colSpan', containerTagName: 'tr', tagName: 'td'},
{name: 'content', tagName: 'meta'},
{name: 'content', containerTagName: 'head', tagName: 'meta'},
{name: 'contentEditable'},
{
name: 'contentScriptType',
Expand Down Expand Up @@ -934,8 +934,13 @@ const attributes = [
{name: 'href', tagName: 'a', overrideStringValue: 'https://reactjs.com'},
{name: 'hrefLang', read: getAttribute('hreflang')},
{name: 'htmlFor', tagName: 'label'},
{name: 'http-equiv', tagName: 'meta', read: getProperty('httpEquiv')},
{name: 'httpEquiv', tagName: 'meta'},
{
name: 'http-equiv',
containerTagName: 'head',
tagName: 'meta',
read: getProperty('httpEquiv'),
},
{name: 'httpEquiv', containerTagName: 'head', tagName: 'meta'},
{name: 'icon', tagName: 'command', read: getAttribute('icon')},
{name: 'id'},
{name: 'ID', read: getProperty('id')},
Expand Down Expand Up @@ -1076,6 +1081,7 @@ const attributes = [
{name: 'label', tagName: 'track'},
{name: 'LANG', read: getProperty('lang')},
{name: 'lang'},
{name: 'lang', containerTagName: 'document', tagName: 'html'},
{name: 'length', read: getAttribute('length')},
{
name: 'lengthAdjust',
Expand Down Expand Up @@ -1981,6 +1987,16 @@ const attributes = [
overrideStringValue:
'translate(-10,-20) scale(2) rotate(45) translate(5,10)',
},
{
name: 'transform-origin',
tagName: 'svg',
read: getSVGAttribute('transform-origin'),
},
{
name: 'transformOrigin',
tagName: 'svg',
read: getSVGAttribute('transform-origin'),
},
{name: 'type', tagName: 'button', overrideStringValue: 'reset'},
{
name: 'type',
Expand Down
1 change: 0 additions & 1 deletion fixtures/blocks/.env

This file was deleted.

Loading