Skip to main content

Testing

Testing

Our SDKs and Clients have library and language-specific testing advice. We recommend you checkout the docs for the SDK or client you're using.

To keep your tests speedy and consistent, we recommend avoiding connections to our server and to instead prefer relying on local data for test setup. Specifying a PrefabEnv of 'test' and putting data in .prefab.test.config.yaml is covered in Default Files.

Server-side SDKs

Specify LOCAL_ONLY and use your config.yaml file.

options = Prefab::Options.new(data_sources: LOCAL_ONLY)

client = Prefab::Client.initialize(options)

Read the full Ruby testing docs.

Client-side Libraries

Rather than talking to the server, use setConfig or use a Provider manually with your test setup.

Don't call prefab.init. Instead, use setConfig to set up your scenario.

prefab.setConfig({
turbo: true,
defaultMediaCount: 3,
});

Read the full JavaScript testing docs.