How to use the ferrum.assertEquals function in ferrum

To help you get started, we’ve selected a few ferrum 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 adobe / helix-pipeline / test / testSetXMLStatus.js View on Github external
it('sets a terse 500 for an error in production', () => {
    const ctx = selectStatus(true)({ content: { }, error }, { logger });
    assertEquals(ctx.response.status, 500);
    assertEquals(ctx.response.body, '');
  });
github adobe / helix-pipeline / test / testSetXMLStatus.js View on Github external
it('sets a verbose 500 for an error in dev', () => {
    const ctx = selectStatus(false)({ content: { }, error }, { logger });
    assertEquals(ctx.response.status, 500);
    assertEquals(ctx.response.body, `<code>500</code>${error}`);
    assertEquals(ctx.response.headers['Content-Type'], 'application/xml');
  });
github adobe / helix-pipeline / test / testSetXMLStatus.js View on Github external
it('sets a verbose 500 for an error in dev', () =&gt; {
    const ctx = selectStatus(false)({ content: { }, error }, { logger });
    assertEquals(ctx.response.status, 500);
    assertEquals(ctx.response.body, `<code>500</code>${error}`);
    assertEquals(ctx.response.headers['Content-Type'], 'application/xml');
  });
github adobe / helix-pipeline / test / testSetXMLStatus.js View on Github external
it('sets a verbose 500 for an error in production if x-debug header is present', () =&gt; {
    const request = {
      headers: {
        'x-debug': 'true',
      },
    };
    const ctx = selectStatus(true)({ content: { }, error }, { logger, request });
    assertEquals(ctx.response.status, 500);
    assertEquals(ctx.response.body, `<code>500</code>${error}`);
    assertEquals(ctx.response.headers['Content-Type'], 'application/xml');
  });
github adobe / helix-pipeline / test / testSetXMLStatus.js View on Github external
it('sets a 200 if all good', () => {
    const ctx = selectStatus(false)({
      content: {
        xml: {
          root: {},
        },
      },
    },
    { logger });
    assertEquals(ctx.response.status, 200);
  });
});
github adobe / helix-pipeline / test / testRewriteStatic.js View on Github external
it('Ignores non-HTML', () => {
    const dat = {
      response: {
        body: '{}',
        headers: {
          'Content-Type': 'application/json',
        },
      },
    };
    const dat2 = deepclone(dat);
    rewrite(dat);
    assertEquals(dat, dat2);
  });
github adobe / helix-pipeline / test / testSetXMLStatus.js View on Github external
it('keeps an existing status', () => {
    const ctx = selectStatus(false)({
      response: {
        status: 201,
      },
    }, { logger });
    assertEquals(ctx.response.status, 201);
  });

ferrum

Features from the rust language in javascript: Provides Traits/Type classes & an advanced library for working with sequences/iterators in js.

Apache-2.0
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis