Creating API Stubs

The best way to test your application and ensure that all data bindings work, is using actual data. In a typical SPA, this data would be fetched from a remote web API. However, this API may still be under construction or not be available at all. Therefore JitBlox allows you to simulate these using API Stubs and Mock data.

Stub operations

API Stubs let you define a set of operations that would otherwise be performed against a real API endpoint. When you create components that need to fetch their data from a backend, you can select any of the API operations that you defined in an API Stub. By doing so, JitBlox will generate all of the necessary code, such as Angular services, observable properties and async pipes.

API Stubs

Mock data

An API stub also needs to return some data, which is what mock data sets are for: setting up test data. Once you created a mock data set, you can return that data set as the result of an API operation. Multiple operations can return data from the same data set, as long as the type of the data set matches the return type of the operation. API operations can also accept filter parameters that allows you to return a subset of the associated mock data set.