Skip to content

collector.collect() doesn't throw in 1.1.0 #36

@markreid

Description

@markreid

Hi,

We've just updated Publication Collector to 1.1.0 and it's broken a few of our tests. Given that you've added support for Promises, I'd say this is probably something you'd consider "expected behaviour", but I was thinking you might want to update the changelog/history to note that it's a potentially breaking change.

Example of the problem:

// FooBarQux is a publication that has a check(argument, String) call for type-checking arguments
describe('FooBarQux subscription', () => {
    it('Takes a String argument', () => {
      const collector = new PublicationCollector();
      expect(() => collector.collect('OrganisationDetail'))
      .to.throw(/Match error/);

      expect(() => collector.collect('FooBarQux', {
        foo: 'bar',
      }))
      .to.throw(/Match error/);
    });
  });

This test has regressed because collector.collect() no longer re-throws errors that are thrown by the publication; instead it returns a promise and rejects it.

This is obviously expected behaviour and we've updated our test suite accordingly, but I can only assume that anybody else testing for publication errors has been doing something similar, so I'd argue that this is potentially a breaking change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions