How to use the fluture.resolve function in fluture

To help you get started, we’ve selected a few fluture 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 fluture-js / fluture-express / test / index.js View on Github external
  const mockNoResponse = middleware (function mock() { return resolve (null); });
  /* eslint-enable prefer-arrow-callback */
github howtocards / frontend / mock-server / server / api / middlewares / api-wrapper.js View on Github external
const resolveMiddlewareToFuture = async (ctx, next) => {
  try {
    return Future.resolve(await next())
  } catch (error) {
    if (error instanceof CustomError) {
      return Future.reject(error)
    }
    // eslint-disable-next-line no-console
    // console.error('error', error)
    // ctx.app.emit('error', error, ctx)
    return Future.reject(new InternalServerError(error))
  }
}
github fluture-js / fluture-express / test / index.js View on Github external
  const mock = middleware (_ => resolve (Next ({foo: 'bar'})));
  const mockRes = {status: sinon.spy (), json: sinon.spy ()};
github fluture-js / fluture-express / test / index.js View on Github external
  const mock = middleware (function mock() { return resolve (Json (200, {})); });
  const mockNoFuture = middleware (function mock() { return null; });
github fluture-js / fluture-express / test / mock-action.js View on Github external
module.exports = _ => resolve (Json (200, {foo: 'bar'}));
github fluture-js / fluture-express / test / index.js View on Github external
  const mock = middleware (_ => resolve (Stream (201, 'jpeg', mockStream)));
  const mockRes = {status: methodSpy (), type: methodSpy ()};
github fluture-js / fluture-express / test / index.js View on Github external
  const mock = middleware (_ => resolve (Redirect (200, 'example.com')));
  const mockRes = {redirect: sinon.spy ()};
github fluture-js / fluture-express / test / index.js View on Github external
  const mock = middleware (_ => resolve (Json (200, {foo: 'bar'})));
  const mockRes = {status: methodSpy (), json: methodSpy ()};
github fluture-js / fluture-express / test / index.js View on Github external
  const mock = middleware (_ => resolve (Empty));
  const mockRes = {status: methodSpy (), end: methodSpy ()};
github howtocards / frontend / mock-server / server / api / middlewares / auth.js View on Github external
.chainRej((error) =>
        error instanceof AuthorizationError ? Future.resolve() : error,
      )