Skip to content

Commit

Permalink
Merge pull request #29711 from storybookjs/backwards-compat-run-all
Browse files Browse the repository at this point in the history
Core: Emit deprecated `TESTING_MODULE_RUN_ALL_REQUEST` for backward compatibility
  • Loading branch information
ghengeveld authored Nov 26, 2024
2 parents 8e5be14 + 2161c5a commit ac03998
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/core/src/core-events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ enum events {
TESTING_MODULE_CRASH_REPORT = 'testingModuleCrashReport',
TESTING_MODULE_PROGRESS_REPORT = 'testingModuleProgressReport',
TESTING_MODULE_RUN_REQUEST = 'testingModuleRunRequest',
/** @deprecated Use TESTING_MODULE_RUN_REQUEST instead */
TESTING_MODULE_RUN_ALL_REQUEST = 'testingModuleRunAllRequest',
TESTING_MODULE_CANCEL_TEST_RUN_REQUEST = 'testingModuleCancelTestRunRequest',
TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE = 'testingModuleCancelTestRunResponse',
TESTING_MODULE_WATCH_MODE_REQUEST = 'testingModuleWatchModeRequest',
Expand Down Expand Up @@ -158,6 +160,7 @@ export const {
TESTING_MODULE_CRASH_REPORT,
TESTING_MODULE_PROGRESS_REPORT,
TESTING_MODULE_RUN_REQUEST,
TESTING_MODULE_RUN_ALL_REQUEST,
TESTING_MODULE_CANCEL_TEST_RUN_REQUEST,
TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE,
TESTING_MODULE_WATCH_MODE_REQUEST,
Expand Down
5 changes: 5 additions & 0 deletions code/core/src/manager-api/modules/experimental_testmodule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Addon_TypesEnum, type StoryId } from '@storybook/core/types';

import {
TESTING_MODULE_CANCEL_TEST_RUN_REQUEST,
TESTING_MODULE_RUN_ALL_REQUEST,
TESTING_MODULE_RUN_REQUEST,
TESTING_MODULE_WATCH_MODE_REQUEST,
type TestProviderId,
Expand Down Expand Up @@ -93,6 +94,10 @@ export const init: ModuleFn<SubAPI, SubState> = ({ store, fullAPI }) => {
};

fullAPI.emit(TESTING_MODULE_RUN_REQUEST, payload);

// For backwards compatibility:
fullAPI.emit(TESTING_MODULE_RUN_ALL_REQUEST, { providerId: id });

return () => api.cancelTestProvider(id);
}

Expand Down
3 changes: 3 additions & 0 deletions code/core/src/manager/globals/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ export default {
'TESTING_MODULE_CONFIG_CHANGE',
'TESTING_MODULE_CRASH_REPORT',
'TESTING_MODULE_PROGRESS_REPORT',
'TESTING_MODULE_RUN_ALL_REQUEST',
'TESTING_MODULE_RUN_REQUEST',
'TESTING_MODULE_WATCH_MODE_REQUEST',
'TOGGLE_WHATS_NEW_NOTIFICATIONS',
Expand Down Expand Up @@ -876,6 +877,7 @@ export default {
'TESTING_MODULE_CONFIG_CHANGE',
'TESTING_MODULE_CRASH_REPORT',
'TESTING_MODULE_PROGRESS_REPORT',
'TESTING_MODULE_RUN_ALL_REQUEST',
'TESTING_MODULE_RUN_REQUEST',
'TESTING_MODULE_WATCH_MODE_REQUEST',
'TOGGLE_WHATS_NEW_NOTIFICATIONS',
Expand Down Expand Up @@ -940,6 +942,7 @@ export default {
'TESTING_MODULE_CONFIG_CHANGE',
'TESTING_MODULE_CRASH_REPORT',
'TESTING_MODULE_PROGRESS_REPORT',
'TESTING_MODULE_RUN_ALL_REQUEST',
'TESTING_MODULE_RUN_REQUEST',
'TESTING_MODULE_WATCH_MODE_REQUEST',
'TOGGLE_WHATS_NEW_NOTIFICATIONS',
Expand Down

0 comments on commit ac03998

Please sign in to comment.