Partnered Account for Testing Purposes

You don’t have to “reconstruct the Twitch API”, you can literally copy/paste examples from the docs to use as mock data.

Twitch announce breaking changes to documented services well in advance, so there should be sufficient time to make any required adjustments to testing as needed. The vast majority of developers (ranging from new developers to larger organisations) have handled the rare occasions where there has been a breaking change to the API without issue.

Amazon may be one of the largest companies on Earth, but Twitch certainly isn’t, Creating what you’re suggesting isn’t some simple thing they can throw out there, it takes development time away from other features, and requires time and effort to maintain. Twitch may be working on such features already for all we know as this is nothing new what you’re suggesting, but just keep in mind this is far from essential or critical as the majority of developers have integrated with the Twitch API fine for years, and so would be prioritised as such when it comes to where they choose to focus their resources.

So let’s say I want to test the Pub/Sub API that requires a websocket connection and you to subscribe to specific topics.

Should the user be required to create a mock Pub/Sub API locally?

In your example, how would I have been able to figure out that I was not subscribed to a topic if I only copied the mock data?

So the burden of developing something for API testing should be pushed onto the API consumers, where the total combined time of maintain a mock API and time wasted from lack of proper testing would likely exponentially exceed the time Twitch would need to create a mock API?

Things like GET or POST endpoints don’t need it, Drops probably don’t need it, etc. So the only thing that really needs it is PubSub and the EventSub I guess. Is it that difficult to create a dashboard that taps into whatever services manage the Pub/Sub websocket connection to send events?

Also, the idea of writing code directly in your application just to test is silly. If the point is testing the Pub/Sub aspect of the API through a websocket connection, how would copying data directly into a variable solve that problem?

I guess if the consumer made their own websocket Pub/Sub server to mock the Twitch API, they could just swap out the twitch links for their local links in something like a dotenv file, but then what if you just wrote the wrong URL into the dotenv file or in your application’s config?

I get what you’re trying to say, but there really is just no excuse. Many other services that use Pub/Sub have testing on their end. I doubt that the cost to create maintain a testing environment, at least for their Pub/Sub where it is needed and has no other method to test than literally buying subs or bits is that significant.

This thread you continue to bump was made over 6 years ago. You’ve made a feature request, and I’d suggest voting for the existing ones, and if you want more information on best practices for testing and using mock data I suggest searching the forum and the dev discord as it is a topic that has been covered many times previously.

I searched the user voice and here for related topics.

User Voice only had one or two relative to API testing, and it was only for specific things. I upvoted one, but then made my own since I couldn’t find one relative to what I was suggesting, as the others were very specific to different parts of the API.

The forum goes to many posts relative to my topic (including this one), and many that aren’t super relative, but still about testing in general:

This thread we are talking in shows a staff member replying 6 years ago saying it’s a good idea, but with no response.

Here’s one where you were condescending to a user when they were clear in what they were asking.

Here’s another where you mention “which is quite trivial to meet the requirements of” in a condescending way. Should a developer really farm a Twitch account for days just to be able to test Affiliate features?

In this one, you mention:

…everyone has made do perfectly fine so far by just creating mock data based on the docs to test their functions.

Okay, people have “made do”, but is that really an excuse to stop asking for the feature when so many people want it and it would be a huge improvement in the API?

There is clearly a huge desire for this sort of functionality (since it is standard with almost every other API in existence). Or at least in the case of many APIs, making test accounts is easy and doesn’t cost anything most of the time if they don’t have a built-in functionality.

I’m not saying stop asking for the feature, I’m saying that Twitch are well aware that some devs have asked for it, and that UserVoice is the appropriate place to suggest such features and for developers to show Twitch what sort of demand there is for them.

You’ve made your voice heard, so there’s no need to keep repeating, and while this feature at some point in the future may help developers it doesn’t help developers right now who need to properly test their Twitch integration which is why it’s important to teach new devs how they can make use of mock data based on the documentation.