#bmizerany1234

1 messages · Page 1 of 1 (latest)

carmine fieldBOT
fickle mauve
#

The full test in App.test.tsx is ```import { render, getMockContextProps } from "@stripe/ui-extension-sdk/testing";
import { ContextView } from "@stripe/ui-extension-sdk/ui";

import App from "./App";

// This is helpful: https://stripe.com/docs/stripe-apps/ui-testing

describe("App", () => {
it("renders ContextView", () => {
const { wrapper } = render(<App {...getMockContextProps()} />);

expect(wrapper.find(ContextView)).toContainText("save to reload this view");

});
});```

#

Other than the comment with the doc link, it remains unchanged from what stripe apps create generated

sacred hinge
#

Is this test file App.test.tsx from stripe apps create?

fickle mauve
#

yes

#

Well you got me a little. It used to be ProductDetailView.test.tsx

#

Are file names important and need to stick to some convention?

#

I renamed it to AppView{.test.tsx,.tsx} (along with the export to AppView) and I still get the same error for yarn test

sacred hinge
#

If you run the default test cases without any modification, does it work?

fickle mauve
#

trying

#

yes

#

works fine

#

hrm

#

I created my app awhile ago

#

and have likely upgrade stripe apps. Has anything changed?

#

(e.g. I was not writting tests while spiking my idea out so didn't try testing until now)

#

nah the test is identical

#

ohh!

#

I think I got it

#
/* eslint-env node */
/* eslint-disable @typescript-eslint/no-var-requires */
import UIExtensionsConfig from "@stripe/ui-extension-tools/jest.config.ui-extension";

export default {
  ...UIExtensionsConfig,
};```
sacred hinge
#

Great to hear that it's working fine now. It might be some dependencies weren't downloaded or configured properly previously

fickle mauve
#
/* eslint-env node */
/* eslint-disable @typescript-eslint/no-var-requires */
const UIExtensionsConfig = require("@stripe/ui-extension-tools/jest.config.ui-extension");

module.exports = {
  ...UIExtensionsConfig,
};```
#

these jest configs are not quite identical.

#

copying the newly generated one over to see if that helps

#

yeah that got me past the original error

#

thank you for the help

sacred hinge
#

Yay! Glad to see everything works out well now 🙌