React & Cypress Component Tests: How to pass an object to an imported library in the Cypress setup?

I’m setting up Cypress to run component tests on a React-based app. The app uses multiple libraries, which I cannot change in any way. Although the app runs perfectly well, I’m unable to get any Cypress tests to run as an object ‘palette’ is not available in one of the libraries, and I get this error message:

(uncaught exception)TypeError: Cannot read properties of undefined (reading 'silver')

This is the code in the library that is failing:

export default ({ palette }: Theme) => ({
  offBackground: palette.colors.silver,
  etc...

I’m using cypress/support/component.js for setting up the configuration, and the component being tested is nested inside a number of context providers:

<I18nContext.Provider value={i18n.english}>
  <ThemeProvider theme={theme}>
    {component}
  </ThemeProvider>
</I18nContext.Provider>

I can import the palette object into the component.js file – is there a way of making it globally available so that it is useable by the library when it is imported?