Frontend: Move toEmit jest matchers to shared workspace (#108610)

* feat(test-utils): move the toEmitValue/s jest matchers to test-utils and add test script

* chore(jest): update configs to use matchers from test-utils package

* ci(frontend-tests): hook up packages tests

* fix(test-utils): re-export matchers from index.ts so packages that include setupTests don't error

* ci(pr-frontend-unit-tests): add frontend-packages-unit-tests to list of required unit tests

* Update packages/grafana-test-utils/README.md

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
Jack Westbrook
2025-07-30 14:39:44 +02:00
committed by GitHub
co-authored by Ivana Huckova
parent afdb3d7c95
commit b707cd28f1
28 changed files with 137 additions and 26 deletions
@@ -107,6 +107,24 @@ jobs:
- run: yarn install --immutable --check-cache
- run: yarn run plugin:test:ci
frontend-packages-unit-tests:
needs: detect-changes
if: needs.detect-changes.outputs.changed == 'true'
runs-on: ubuntu-latest-8-cores
name: "Packages unit tests"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- run: yarn install --immutable --check-cache
- run: yarn run packages:test:ci
# This is the job that is actually required by rulesets.
# We need to require EITHER the OSS or the Enterprise job to pass.
# However, if one is skipped, GitHub won't flat-map the shards,
@@ -116,6 +134,7 @@ jobs:
- frontend-unit-tests
- frontend-unit-tests-enterprise
- frontend-decoupled-plugin-tests
- frontend-packages-unit-tests
# always() is the best function here.
# success() || failure() will skip this function if any need is also skipped.
# That means conditional test suites will fail the entire requirement check.