jest-plugin-must-assert

A jest plugin to ensure assertions happen within all tests at runtime

Stars
26
jest-plugin-must-assert - Expose stack task stack traces Latest Release

Published by ballercat about 3 years ago

This version includes a breaking API change

New Feature

New feature, add getStackTrace to onInvokeTask. This allows users to inspect the stack prior to blocking a task.

Breaking Change

taskType and taskSource have been replaced with a task object in the onInvokeTask API

jest-plugin-must-assert - Semver correction.

Published by ballercat about 3 years ago

Version 2.1.0 breaks public API this is a correction to version 2.x

jest-plugin-must-assert - Expose stack task stack traces

Published by ballercat about 3 years ago

New feature, add getStackTrace to onInvokeTask. This allows users to inspect the stack prior to blocking a task.

jest-plugin-must-assert - Fail tests with unhandled Promise rejections

Published by ballercat over 4 years ago

This release comes with a major patch that may fail a larger portion of your tests.

  • Any unhandled promise rejection during an async test will now fail a test. Example
test('unhandled promise rejections fail tests', () => {
  Promise.resolve().then(() => {
    throw new Error('oops');
  });
  return wait(() => {
    expect(1).toBe(1);
  });
});

With plugin versions prior to v2.0.0 the test above would pass. This brings the plugin inline with Jest behavior, which will fail the test above by default.

API Changes

  • ignoreStack[] option can be used to control which parts of the stack(s) are printed by the plugin when alerting on ignored async tasks. This was previously undocumented.
jest-plugin-must-assert - Support jsdom environments

Published by ballercat almost 5 years ago

Patch to existing bootstrap to add support for JSDOM environments. Fixes issues with setTimeout family of functions not properly zoned.

New public apis:

  • jest-plugin-must-assert/jsdom instead of just the default jest-plugin-must-assert
  • jest-plugin-must-assert/jsdom-munual instead of just the default manual setup jest-plugin-must-assert/manual
jest-plugin-must-assert - Bugfix todo

Published by ballercat almost 5 years ago

jest-plugin-must-assert - v1.4.1

Published by ballercat over 5 years ago

  • Tag a first "release"
  • Fix npm audit alerts (#6)
  • Fix synchronous failures not failing tests (#4)