From 55ffd9c4c75f35fca98cc4f8f50fe41900cdf996 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 23 Jul 2026 17:23:13 +0800 Subject: [PATCH] test: run Premium Analytics JavaScript tests in CI --- .../changelog/enable-premium-analytics-js-tests-ci | 3 +++ projects/packages/premium-analytics/composer.json | 2 ++ projects/packages/premium-analytics/package.json | 1 + .../changelog/enable-premium-analytics-js-tests-ci | 4 ++++ projects/plugins/mu-wpcom-plugin/composer.lock | 8 +++++++- .../changelog/enable-premium-analytics-js-tests-ci | 4 ++++ projects/plugins/premium-analytics/composer.lock | 8 +++++++- .../changelog/enable-premium-analytics-js-tests-ci | 4 ++++ projects/plugins/wpcomsh/composer.lock | 8 +++++++- 9 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 projects/packages/premium-analytics/changelog/enable-premium-analytics-js-tests-ci create mode 100644 projects/plugins/mu-wpcom-plugin/changelog/enable-premium-analytics-js-tests-ci create mode 100644 projects/plugins/premium-analytics/changelog/enable-premium-analytics-js-tests-ci create mode 100644 projects/plugins/wpcomsh/changelog/enable-premium-analytics-js-tests-ci diff --git a/projects/packages/premium-analytics/changelog/enable-premium-analytics-js-tests-ci b/projects/packages/premium-analytics/changelog/enable-premium-analytics-js-tests-ci new file mode 100644 index 000000000000..20a360e32e71 --- /dev/null +++ b/projects/packages/premium-analytics/changelog/enable-premium-analytics-js-tests-ci @@ -0,0 +1,3 @@ +Significance: patch +Type: changed +Comment: Enable the existing JavaScript test and coverage suites in CI. diff --git a/projects/packages/premium-analytics/composer.json b/projects/packages/premium-analytics/composer.json index e5dccf9c5dcf..65e677faad5f 100644 --- a/projects/packages/premium-analytics/composer.json +++ b/projects/packages/premium-analytics/composer.json @@ -30,6 +30,8 @@ ], "test-php": "@composer phpunit", "test-php-coverage": "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"", + "test-js": "pnpm run test", + "test-js-coverage": "pnpm run test-coverage", "build-development": [ "pnpm run build" ], diff --git a/projects/packages/premium-analytics/package.json b/projects/packages/premium-analytics/package.json index 9614375eb6e0..db63d7a5f051 100644 --- a/projects/packages/premium-analytics/package.json +++ b/projects/packages/premium-analytics/package.json @@ -11,6 +11,7 @@ "build-production": "NODE_ENV=production BABEL_ENV=production pnpm run build:wp-build && pnpm run build:strip-unminified-prod && pnpm run build:boot-asset && pnpm run validate", "storybook": "cd ../../js-packages/storybook && pnpm run storybook:dev", "test": "jest --config=tests/jest.config.cjs", + "test-coverage": "pnpm run test --coverage", "typecheck": "tsgo --noEmit", "validate": "pnpm exec validate-es --no-error-on-unmatched-pattern build/", "watch": "wp-build --watch" diff --git a/projects/plugins/mu-wpcom-plugin/changelog/enable-premium-analytics-js-tests-ci b/projects/plugins/mu-wpcom-plugin/changelog/enable-premium-analytics-js-tests-ci new file mode 100644 index 000000000000..459f4637b59b --- /dev/null +++ b/projects/plugins/mu-wpcom-plugin/changelog/enable-premium-analytics-js-tests-ci @@ -0,0 +1,4 @@ +Significance: patch +Type: changed +Comment: Sync Premium Analytics dependency metadata. + diff --git a/projects/plugins/mu-wpcom-plugin/composer.lock b/projects/plugins/mu-wpcom-plugin/composer.lock index 8244878e3fbd..6660522c7930 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.lock +++ b/projects/plugins/mu-wpcom-plugin/composer.lock @@ -1727,7 +1727,7 @@ "dist": { "type": "path", "url": "../../packages/premium-analytics", - "reference": "8a37e653800a0f6eab73996b880000796cd0ff4c" + "reference": "65140eaa3f8196b645d464edf243e9282a392e13" }, "require": { "automattic/jetpack-assets": "@dev", @@ -1775,6 +1775,12 @@ "test-php-coverage": [ "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"" ], + "test-js": [ + "pnpm run test" + ], + "test-js-coverage": [ + "pnpm run test-coverage" + ], "build-development": [ "pnpm run build" ], diff --git a/projects/plugins/premium-analytics/changelog/enable-premium-analytics-js-tests-ci b/projects/plugins/premium-analytics/changelog/enable-premium-analytics-js-tests-ci new file mode 100644 index 000000000000..459f4637b59b --- /dev/null +++ b/projects/plugins/premium-analytics/changelog/enable-premium-analytics-js-tests-ci @@ -0,0 +1,4 @@ +Significance: patch +Type: changed +Comment: Sync Premium Analytics dependency metadata. + diff --git a/projects/plugins/premium-analytics/composer.lock b/projects/plugins/premium-analytics/composer.lock index 19e796af8263..8fc657deec36 100644 --- a/projects/plugins/premium-analytics/composer.lock +++ b/projects/plugins/premium-analytics/composer.lock @@ -844,7 +844,7 @@ "dist": { "type": "path", "url": "../../packages/premium-analytics", - "reference": "8a37e653800a0f6eab73996b880000796cd0ff4c" + "reference": "65140eaa3f8196b645d464edf243e9282a392e13" }, "require": { "automattic/jetpack-assets": "@dev", @@ -892,6 +892,12 @@ "test-php-coverage": [ "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"" ], + "test-js": [ + "pnpm run test" + ], + "test-js-coverage": [ + "pnpm run test-coverage" + ], "build-development": [ "pnpm run build" ], diff --git a/projects/plugins/wpcomsh/changelog/enable-premium-analytics-js-tests-ci b/projects/plugins/wpcomsh/changelog/enable-premium-analytics-js-tests-ci new file mode 100644 index 000000000000..459f4637b59b --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/enable-premium-analytics-js-tests-ci @@ -0,0 +1,4 @@ +Significance: patch +Type: changed +Comment: Sync Premium Analytics dependency metadata. + diff --git a/projects/plugins/wpcomsh/composer.lock b/projects/plugins/wpcomsh/composer.lock index d216f23b20ac..792b36d71e05 100644 --- a/projects/plugins/wpcomsh/composer.lock +++ b/projects/plugins/wpcomsh/composer.lock @@ -1908,7 +1908,7 @@ "dist": { "type": "path", "url": "../../packages/premium-analytics", - "reference": "2e38923863dbc23890ece6403cd0ad2fb153b650" + "reference": "3692f77bd05e041fc092112b82042c0c826e52bb" }, "require": { "automattic/jetpack-assets": "@dev", @@ -1956,6 +1956,12 @@ "test-php-coverage": [ "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"$COVERAGE_DIR/php.cov\"" ], + "test-js": [ + "pnpm run test" + ], + "test-js-coverage": [ + "pnpm run test-coverage" + ], "build-development": [ "pnpm run build" ],