Skip to content

Releases: 42BV/react-flash-messages

v2.0.2

20 Feb 10:03
Compare
Choose a tag to compare
  • fix: remove otp option from release script 18bbe23
  • chore: update dependencies 63f1e67

v2.0.1...v2.0.2

v2.0.1

10 Mar 21:04
Compare
Choose a tag to compare
  • chore: update dependencies 81f2d1c

v2.0.0...v2.0.1

v2.0.0

02 Dec 15:54
Compare
Choose a tag to compare

🚨🚨🚨Breaking Changes 🚨🚨🚨

Because of updates to the build process it is no longer possible to use jest to spyOn
the flash messages. This will no longer work jest.spyOn(reactFlashMessages, 'addSuccess');
and will give the following error: TypeError during Jest's spyOn: Cannot set property getRequest of #<Object> which has only a getter.

A simple solution is to mock the entire library.

When using Jest you can add the following in the setupTests.ts file:

// Mock @42.nl/react-flash-messages
jest.mock('@42.nl/react-flash-messages', () => {
  const originalModule = jest.requireActual('@42.nl/react-flash-messages');

  return {
    ...originalModule,
    addError: jest.fn(),
    addWarning: jest.fn(),
    addSuccess: jest.fn(),
    addInfo: jest.fn(),
    addApocalypse: jest.fn(),
    removeFlashMessage: jest.fn()
  }
});

This way by default all flash messages actions are mocked, and there is no need
to do jest.spyOn(reactFlashMessages, 'addSuccess'); ever again.

Other changes:

  • feat: added onRemove callback. 562ca51
  • chore: upgraded all packages, removed travis for GitHub actions. 70bff09

v1.0.0...v2.0.0

v1.0.0

28 Jan 15:14
Compare
Choose a tag to compare

Initial release of the @42.nl/react-flash-messages library.