-
Notifications
You must be signed in to change notification settings - Fork 421
Description
🔖 Need
Issue: ReferenceError: jest is not defined
Context: We recently upgraded our Backstage version and created a custom TechInsights plugin. This plugin has a dependency on @backstage/backend-test-utils. When attempting to run yarn dev, we encounter the following error:
/Users/rxxxmxxxx/Documents/bug-fix-tech-insights/xyzz-idp-app/packages/backend/node_modules/@backstage-community/plugin-tech-insights-backend/node_modules/@backstage/backend-test-utils/src/next/services/mockServices.ts:64
child: jest.fn().mockImplementation(createLoggerMock),
^ReferenceError: jest is not defined
at createLoggerMock (/Users/rxxxmxxxx/Documents/bug-fix-tech-insights/xyzz-idp-app/packages/backend/node_modules/@backstage-community/plugin-tech-insights-backend/node_modules/@backstage/backend-test-utils/src/next/services/mockServices.ts:64)
Steps Taken:
- Upgraded Backstage version.
- Created a custom TechInsights plugin.
- Added @backstage/backend-test-utils as a dependency.
- Ran yarn dev.
Error Details:
- The error occurs in the mockServices.ts file at line 64. (inside my node_modules of backend I am able to see this path "backend/node_modules/@backstage-community/plugin-tech-insights-backend/node_modules/@backstage/backend-test-utils/src/next/services/mockServices.ts:64")
- It seems that jest is not defined in the context where createLoggerMock is being called.
Request for Help: Could anyone provide guidance on how to resolve this ReferenceError? Specifically, how can we ensure that jest is properly defined and available in the context of mockServices.ts?
🎉 Proposal
Issue: ReferenceError: jest is not defined
Context: We recently upgraded our Backstage version and created a custom TechInsights plugin. This plugin has a dependency on @backstage/backend-test-utils. When attempting to run yarn dev, we encounter the following error:
/Users/rxxxmxxxx/Documents/bug-fix-tech-insights/xyzz-idp-app/packages/backend/node_modules/@backstage-community/plugin-tech-insights-backend/node_modules/@backstage/backend-test-utils/src/next/services/mockServices.ts:64
child: jest.fn().mockImplementation(createLoggerMock),
^ReferenceError: jest is not defined
at createLoggerMock (/Users/rxxxmxxxx/Documents/bug-fix-tech-insights/xyzz-idp-app/packages/backend/node_modules/@backstage-community/plugin-tech-insights-backend/node_modules/@backstage/backend-test-utils/src/next/services/mockServices.ts:64)
when we checked this repo link for latest @backstage/backend-test-utils but after doing yarn install and yarn dev we are getting jest not define.
〽️ Alternatives
No response
❌ Risks
No response
👀 Have you spent some time to check if this RFC has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct