How to use the fusion-test-utils.render function in fusion-test-utils

To help you get started, we’ve selected a few fusion-test-utils 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 fusionjs / fusionjs / fusion-plugin-csrf-protection / src / __tests__ / index.node.js View on Github external
test('render request', async t => {
  const Session = getSession();
  const app = new App('fake-element', el => el);
  app.plugin(CsrfToken, {Session});

  const ctx = await render(app, '/');
  t.notok(
    ctx.response.headers['x-csrf-token'],
    'does not set x-csrf-token header'
  );
  t.equals(ctx.response.status, 200, 'has right status');
  t.ok(Session.of(ctx).get('csrf-secret'), 'sets the session');
  t.ok(
    ctx.response.body.includes('

fusion-test-utils

Test utilities for FusionJS

MIT
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis

Similar packages