Cryrivers / manta-style

🚀 The futuristic API Mock Server for Frontend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snapshot hot swapping

Cryrivers opened this issue · comments

Purposed Syntax, not finalized yet.

import ms from '@manta-style/test-helper';

describe('test', () => {
  beforeAll(async () => {
    await ms.setup('path/to/configFile.ts');
  });
  afterAll(async () => {
    await ms.teardown();
  });
  test('some test', async () => {
    await ms.loadSnapshot('path/to/successSnapshot.json');
    // Test cases for success response...
    await ms.loadSnapshot('path/to/failureSnapshot.json');
    // Test cases for failure response...
  });
});