Add a JavaScript or CSS asset to the HTML generated by html-webpack-plugin
Fake setTimeout and friends (collectively known as "timers"). Useful in your JavaScript tests. Extracted from Sinon.JS
docs: bring back missing images (#13863)
Currently one of the blog posts has missing images:
That’s a historical document. Probably it is enough to bring back the missing images which got removed accidentally in #6163.
Deploy preview
feat(jest-core): Add performance markers around significant lifecycle events (#13859)
I'd like to upstream some of the work we've been doing over in Metro to improve startup times (particularly with an overhaul of jest-haste-map
that started by forking it), and possibly carve out some time to optimise other areas of Jest startup. A first step (especially to get some buy-in at Meta!) is instrumentation - this PR is a stab at adding some key markers via the standard global performance
API.
I'm not wedded to this implementation - open to bikeshedding about labels, abstraction, or if there's a pre-existing Jest instrumentation pattern I'd missed, but I'm particularly looking for some way to time the startup independently of running tests.
Running Jest programmatically in a thin wrapper allows performance data to be gathered:
'use strict';
const {performance} = require('perf_hooks');
if (process.env.NODE_ENV == null) {
process.env.NODE_ENV = 'test';
}
require('jest-cli')
.run()
.then(() => {
console.log(performance.getEntries());
});
[
PerformanceMark {
name: 'jest/runCLI:start',
entryType: 'mark',
startTime: 179.9593139886856,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/buildContextsAndHasteMaps:start',
entryType: 'mark',
startTime: 269.55708903074265,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/buildContextsAndHasteMaps:end',
entryType: 'mark',
startTime: 1525.8082609772682,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/getTestRunData:start',
entryType: 'mark',
startTime: 1535.9708949923515,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/getTestRunData:end',
entryType: 'mark',
startTime: 2911.5280399918556,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/globalSetup:start',
entryType: 'mark',
startTime: 2928.4168980121613,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/globalSetup:end',
entryType: 'mark',
startTime: 2928.6306880116463,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/scheduleAndRun:start',
entryType: 'mark',
startTime: 2938.5601339936256,
duration: 0,
detail: { numTests: 1 }
},
PerformanceMark {
name: 'jest/scheduleAndRun:start',
entryType: 'mark',
startTime: 5480.210482001305,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/cacheResults:start',
entryType: 'mark',
startTime: 5480.292959034443,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/cacheResults:end',
entryType: 'mark',
startTime: 5480.848489999771,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/globalTeardown:start',
entryType: 'mark',
startTime: 5480.870894014835,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/globalTeardown:end',
entryType: 'mark',
startTime: 5480.897032022476,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/processResults:start',
entryType: 'mark',
startTime: 5480.90157699585,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/processResults:end',
entryType: 'mark',
startTime: 5481.04110699892,
duration: 0,
detail: null
},
PerformanceMark {
name: 'jest/runCLI:end',
entryType: 'mark',
startTime: 5481.130716025829,
duration: 0,
detail: null
}
]
chore: Cleanup incorrect links in CHANGELOG.md (#13857)
I happened to find some of the PRs' links in CHANGELOG.md are incorrect (different IDs in text and URLs), due to mistake when copying and pasting them:
https://github.com/facebook/jest/blob/48ddbf49535290aa9cd0e990f44d583c1baab96e/CHANGELOG.md?plain=1#L862
So I wrote a small script like this to find all of them (hopefully):
const fs = require('fs');
const regex =
/\[#(\d+)\]\(https:\/\/github.com\/facebook\/jest\/pull\/(\d+)\)/g;
const data = fs.readFileSync('CHANGELOG.md', 'utf-8');
for (const match of data.matchAll(regex))
if (match[1] !== match[2]) console.error(`Error: ${match[0]}`);
And it outputs:
Error: [#12763](https://github.com/facebook/jest/pull/12899)
Error: [#11523](https://github.com/facebook/jest/pull/11567)
Error: [#8751](https://github.com/facebook/jest/pull/8829)
Error: [#10393](https://github.com/facebook/jest/pull/10400)
Error: [#10217](https://github.com/facebook/jest/pull/10237)
Error: [#8448](https://github.com/facebook/jest/pull/8665)
Error: [#7985](https://github.com/facebook/jest/pull/8003)
Error: [#7809](https://github.com/facebook/jest/pull/7972)
Error: [#6792](https://github.com/facebook/jest/pull/6810)
Error: [#5948](https://github.com/facebook/jest/pull/5953)
Error: [#5858](https://github.com/facebook/jest/pull/3497)
Error: [#5154](https://github.com/facebook/jest/pull/5502)
Error: [#4837](https://github.com/facebook/jest/pull/4629)
I manually checked them one by one and fixed them in this PR.
~(Maybe we can add a step somewhere in the CI to detect such error.)~
A CI step is added to check this, see discussion below.
Update scripts/checkChangelog.mjs
Ah nice, thanks @SuperSodaSea!
So I wrote a small script like this to find all of them (hopefully):
Can you add that script to the repo? We can run it as part of some CI run to verify links are correct
Yay, super exciting! I've wanted to do this sort of things for years, but never got around to it. I'm actually working on instrumentation at work atm (albeit using open telemetry), so it's been on my mind lately to get into it for Jest as well.
docs: fix link formatting in Expect API page (#13860)
Accidentally found a link in Expect API page which is incorrectly formatted.
Deploy preview.
docs: remove extraneous tab symbol (#13861)
Remove extraneous tab symbol in Using with webpack page.
Deploy preview.
Update docusaurus monorepo to v2.3.1 (#555)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @docusaurus/core | 2.2.0
-> 2.3.1
| |
|
|
|
| @docusaurus/module-type-aliases |
2.2.0
-> 2.3.1
| |
|
|
|
| @docusaurus/preset-classic |
2.2.0
-> 2.3.1
| |
|
|
|
v2.3.1
docusaurus-theme-common
docusaurus-theme-classic
, docusaurus-theme-common
docusaurus-utils
docusaurus-preset-classic
docusaurus-theme-translations
docusaurus-plugin-client-redirects
, docusaurus-theme-search-algolia
, docusaurus
v2.3.0
docusaurus-theme-translations
docusaurus-plugin-content-blog
docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus
docusaurus
docusaurus-theme-search-algolia
docusaurus-plugin-google-tag-manager
docusaurus-mdx-loader
docusaurus-theme-common
docusaurus
docusaurus-theme-classic
, docusaurus
docusaurus-theme-search-algolia
docusaurus-theme-classic
, docusaurus-theme-common
docusaurus-theme-classic
docusaurus-theme-translations
docusaurus-plugin-content-blog
docusaurus-plugin-content-docs
docusaurus-utils
create-docusaurus
, docusaurus-theme-classic
docusaurus-theme-classic
, docusaurus
docusaurus-theme-translations
eslint-plugin
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.
Bumps http-cache-semantics from 4.1.0 to 4.1.1.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)@dependabot use these labels
will set the current labels as the default for future PRs for this repo and language@dependabot use these reviewers
will set the current reviewers as the default for future PRs for this repo and language@dependabot use these assignees
will set the current assignees as the default for future PRs for this repo and language@dependabot use this milestone
will set the current milestone as the default for future PRs for this repo and languageYou can disable automated security fix PRs for this repo from the Security Alerts page.
Bumps ua-parser-js from 0.7.31 to 0.7.33.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)@dependabot use these labels
will set the current labels as the default for future PRs for this repo and language@dependabot use these reviewers
will set the current reviewers as the default for future PRs for this repo and language@dependabot use these assignees
will set the current assignees as the default for future PRs for this repo and language@dependabot use this milestone
will set the current milestone as the default for future PRs for this repo and languageYou can disable automated security fix PRs for this repo from the Security Alerts page.