Testing .web.js backend modules

I just encountered the .web.js replacement for .jsw modules, as I am using the classic Editor for my site. I understand why this is being done, but it seems like the classic Editor will no longer allow direct testing of a .web.js module without creating some kind of front end page to call it. Being able to test backend modules directly is very handy and quite a bit faster than using a front end page to access them.

The documentation indicates that .jsw is deprecated and will no longer be available at some point in the future. Does this only apply to Wix Studio, or also to the classic Editor?

Is there a plan to provide direct testing of .web.js modules or do we always have to call the module from the front end?

Thanks in advance for any comments/guidance.

This is a BUG currently I also have the same issue. You can’t see that play (blue) button to test them within your backend. I think they will fix it soon.

For now you can create a test.js file. Import the function you want to test and export another function in your test.js to test them. It’s just one-time another step but will work without any problem.

I think it’s also possible to test them within .web.js if you use functions instead of factory functions (factory function = const funcName etc…).

Example: In your .web.js:

export const searchFiles = webMethod(Permissions.Anyone, async (term) => {
  //logic of func
});

export async function testing() {
  return await searchFiles();
}