How to use the @seagull/seed.FixtureStorage.createByUrl function in @seagull/seed

To help you get started, we’ve selected a few @seagull/seed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github seagull-js / seagull / packages / services-http / src / mode / seed.ts View on Github external
async fetch(url: string, init?: RequestInit): Promise {
    const seed = FixtureStorage.createByUrl>(
      url,
      init,
      this.testScope
    )

    try {
      const seedFixture = seed.get()
      if (!seed.expired) {
        // seed exists => return seed
        return createResponse(seedFixture)
      }
    } catch {
      // ignore
    }
    const fixture = await this.fetchFixture(url, init)
    seed.set(fixture)
github seagull-js / seagull / packages / services-soap / src / mode / seed.ts View on Github external
const seedify = async (fnc: ClientFunction, name: string, args: any) => {
      const seed = FxSt.createByUrl(
        `${endpoint}/${name}`,
        args,
        this.testScope
      )
      try {
        try {
          if (seed.expired) {
            throw new Error()
          }
          const response = seed.get()
          handleSeedError(response)
          return response
        } catch {
          const response = await fnc(args)
          seed.set(response)
          return response
github seagull-js / seagull / packages / services-soap / src / mode / pure.ts View on Github external
const purify = async (fnc: ClientFunction, name: string, args: any) => {
      const seed = FixtureStorage.createByUrl(
        `${endpoint}/${name}`,
        args,
        this.testScope
      )
      const response = seed.get()
      handleSeedError(response)
      return response
    }

@seagull/seed

Seed implementation for the seagull framework

LGPL-3.0
Latest version published 1 year ago

Package Health Score

49 / 100
Full package analysis