Skip to content

rewrite attester mock to use mockapi.attesterConfig = LEGACY_GLOBAL_ATTESTER_MOCK_CONFIG  #5021

@tomholub

Description

@tomholub

Second wave of PRs: allow local configuration of the mock APIs, but give every test the same configuration:

I would recommend to do this service by service, eg start with only Attester, then FES in another PR, etc.

  ava.default('some test', testWithBrowser(undefined, assignedPort, async (t, browser) => { 
    const mockApi = new MockApi();
    mockApi.fesConfig = LEGACY_GLOBAL_FES_MOCK_CONFIG;
    mockApi.ekmConfig = LEGACY_GLOBAL_EKM_MOCK_CONFIG
    mockApi.attesterConfig = LEGACY_GLOBAL_ATTESTER_MOCK_CONFIG;
    mockApi.googleConfig = LEGACY_GLOBAL_GOOGLE_MOCK_CONFIG;
    await mockApi.withMockedApis(assignedPort, async () => {
      // run browser tests as before

This way, we ensure that all current schenanigans we do for tests can be configured using the new mechanism. But we don't yet do individual configuration per test, because it's a task on its own to figure out which tests need exactly what configuration.

Originally posted by @tomholub in #4494 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions