SimenB
Repos
205
Followers
984
Following
1

Delightful JavaScript Testing.

41345
5967

Add a JavaScript or CSS asset to the HTML generated by html-webpack-plugin

336
39

Fake setTimeout and friends (collectively known as "timers"). Useful in your JavaScript tests. Extracted from Sinon.JS

731
95

Events

docs: bring back missing images (#13863)

Created at 3 hours ago
pull request closed
docs: bring back missing images

Summary

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.

Test plan

Deploy preview

Created at 3 hours ago

feat(jest-core): Add performance markers around significant lifecycle events (#13859)

Created at 7 hours ago
pull request closed
feat(jest-core): Add performance markers around significant lifecycle events

Summary

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.

Test plan

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
  }
]
Created at 7 hours ago

chore: Cleanup incorrect links in CHANGELOG.md (#13857)

Created at 14 hours ago
pull request closed
chore: Cleanup incorrect links in CHANGELOG.md

Summary

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.

Test plan

~(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.

Created at 14 hours ago

Update scripts/checkChangelog.mjs

Created at 14 hours ago
issue comment
chore: Cleanup incorrect links in CHANGELOG.md

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

Created at 15 hours ago
issue comment
feat(jest-core): Add performance markers around significant lifecycle events

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.

Created at 15 hours ago

docs: fix link formatting in Expect API page (#13860)

Created at 15 hours ago
pull request closed
docs: fix link formatting in Expect API page

Summary

Accidentally found a link in Expect API page which is incorrectly formatted.

Test plan

Deploy preview.

Created at 15 hours ago

docs: remove extraneous tab symbol (#13861)

Created at 15 hours ago
pull request closed
docs: remove extraneous tab symbol

Summary

Remove extraneous tab symbol in Using with webpack page.

Test plan

Deploy preview.

Created at 15 hours ago
[near-operations-file] adds unused import
Created at 1 day ago

Update docusaurus monorepo to v2.3.1 (#555)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Created at 1 day ago
SimenB delete branch renovate/docusaurus-monorepo
Created at 1 day ago
pull request closed
Update docusaurus monorepo to v2.3.1

Mend Renovate

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @docusaurus/core | 2.2.0 -> 2.3.1 | age | adoption | passing | confidence | | @docusaurus/module-type-aliases | 2.2.0 -> 2.3.1 | age | adoption | passing | confidence | | @docusaurus/preset-classic | 2.2.0 -> 2.3.1 | age | adoption | passing | confidence |


Release Notes

v2.3.1

Compare Source

:bug: Bug Fix
  • docusaurus-theme-common
    • #​8628 fix(theme-common): fix issue in tab scroll position restoration on tab click (@​slorber)
    • #​8619 fix(theme-common): localStorage utils dispatch too many storage events leading to infinite loop (@​slorber)
    • #​8618 fix(theme-common): prepare usage of useSyncExternalStore compatibility with React 18 (@​slorber)
  • docusaurus-theme-classic, docusaurus-theme-common
  • docusaurus-utils
  • docusaurus-preset-classic
:nail_care: Polish
  • docusaurus-theme-translations
:robot: Dependencies
  • docusaurus-plugin-client-redirects, docusaurus-theme-search-algolia, docusaurus
Committers: 3

v2.3.0

Compare Source

:rocket: New Feature
  • docusaurus-theme-translations
  • docusaurus-plugin-content-blog
  • docusaurus-theme-classic, docusaurus-theme-common, docusaurus
  • docusaurus
    • #​8397 feat(core): deploy CLI - add support for git url "insteadOf": use 'remote get-url' to determine source repo url (@​friederbluemle)
  • docusaurus-theme-search-algolia
    • #​8428 feat(theme-algolia): add option.replaceSearchResultPathname to process/replaceAll search result urls
  • docusaurus-plugin-google-tag-manager
    • #​8470 feat(plugin-google-tag-manager): add new google-tag-manager plugin + deprecate google-analytics plugin (@​lanegoolsby)
:bug: Bug Fix
  • docusaurus-mdx-loader
    • #​8303 fix(mdx-loader): support nested admonitions
    • #​8282 fix(mermaid): fix Mermaid integration for v9.2 release
  • docusaurus-theme-common
  • docusaurus
  • docusaurus-theme-classic, docusaurus
    • #​8445 fix(theme-classic) extract HomeBreadcrumbItem + fix swizzle bugs (@​3v0k4)
  • docusaurus-theme-search-algolia
  • docusaurus-theme-classic, docusaurus-theme-common
    • #​8486 fix(theme): refactor Tabs, make groupId + queryString work fine together (@​slorber)
  • docusaurus-theme-classic
  • docusaurus-theme-translations
    • #​8424 fix(translations): typo in lastUpdatedAtBy Vietnamese translation (@​slorber)
    • #​8289 fix(theme-translations): complete Turkish theme translations
    • #​8406 fix(translations): complete farsi theme translations
    • #​8450 fix(theme-translations): complete Vietnamese theme translations
    • #​8525 chore(theme-translations): complete pl translations
  • docusaurus-plugin-content-blog
  • docusaurus-plugin-content-docs
  • docusaurus-utils
  • create-docusaurus, docusaurus-theme-classic
    • #​8279 fix(create-docusaurus): improve init template misleading doc + add Docuaurus social card (@​slorber)
:nail_care: Polish
  • docusaurus-theme-classic, docusaurus
    • #​8445 fix(theme-classic) extract HomeBreadcrumbItem + fix swizzle bugs (@​3v0k4)
  • docusaurus-theme-translations
  • eslint-plugin
Committers: 16

Configuration

📅 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.


  • [ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Created at 1 day ago
pull request closed
chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1

Bumps http-cache-semantics from 4.1.0 to 4.1.1.

Dependabot compatibility score

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 language

You can disable automated security fix PRs for this repo from the Security Alerts page.

Created at 1 day ago
pull request closed
chore(deps): bump ua-parser-js from 0.7.31 to 0.7.33

Bumps ua-parser-js from 0.7.31 to 0.7.33.

Dependabot compatibility score

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 language

You can disable automated security fix PRs for this repo from the Security Alerts page.

Created at 1 day ago