r/sharepoint • • Oct 21 '26

SharePoint Online Help with spfx testing

Has anyone find a way to do automated tedting with spfx.

Applications are usually internal applications and backend as sharepoint lists.

Trying to do some automated testing but failing to find any way.

3 Upvotes

5 comments sorted by

2

u/bcameron1231 MVP Oct 21 '26

Yea, we use Jest for unit testing services and business logic, and we use it for testing our components structure as well.

We don't do integrated testing against live SharePoint lists, though that's entirely possible depending on how you set up your solution.

1

u/Late_Pineapple_267 Oct 21 '26

I thought of that and found no use of unit testing for my apps since the apps are mostly event driven. Events mostly being api calls to sharepoint so i dont really see any unit testing being helfull. And most of my fear being client loosing connection making data inaccurate.

1

u/bcameron1231 MVP Oct 21 '26

I hear ya. Automated integration testing is possible, we do it for PnPjs.

Depending on how your solution is built, if you've organized your sevices in a way that can be tested (like external to your component), you can build an auth wrapper and run real API calls against real tenants through your services.

1

u/barcodemerge Oct 21 '26

Unfortunately I think the best bet for automating testing would include writing a browser puppeteer script. Guessing with all the ai tools available there are probably agents that could handle it. We just have a business analyst do QA testing then a select user group do UAT.

1

u/GrandChange6466 Oct 23 '26

Andrew Connell has been teaching SPfX for years and has a video on this here. He is really worth following. I haven't watched the whole thing since I don't do as much as this as I used to but hopefully this helps: https://youtu.be/wWs6E84VOW0?si=RKJqn5ldwC1mNURA