Passable Versions Save

Declarative data validations.

7.5.2

4 years ago

Fixes and non breaking changes

  • b71f156 remove unneeded files from package (gaearon)
  • 5427b27 continue my work from 2020-05-25-reduce-bloat (gaearon)
  • 97e074b [Patch] Update CODEOWNERS (#291) (raphaelboukara)

7.5.0

4 years ago

Additions

  • 37ed4d7 [Minor] Add draft as an export from passable (#204) (ealush)
  • aff8c86 [Minor] Create a Passable singleton | future hook support (#213) (ealush)

7.4.0

4 years ago

Additions

  • c0a9aec [MINOR] Add return value for test. (#197) (Evyatar Alush)

Fixes and non breaking changes

  • 7ec4daf Use anyone/any instead of any (#198) (Evyatar Alush)

7.3.0

4 years ago

By @michasherman

Rejecting with rejection message

What if your promise can reject with different messages? No problem! You can reject the promise with your own message by passing it to the rejection callback.

Notice that when using rejection messages we do not need to pass statement argument to test. This means that the statement will always be inferred from the rejection message.

In case you do pass statement, it will serve as a fallback message in any case that the rejection message is not provided.

test('name', new Promise((resolve, reject) => {
    fetch(`/checkUsername?name=${name}`)
        .then(res => res.json)
        .then(data => {
            if (data.status === 'fail') {
                reject(data.message); // rejects with message and marks the test as failing
            } else {
                resolve(); // completes. doesn't mark the test as failing
            }
        });
}));

7.2.0

4 years ago

7.1.1

4 years ago

Added

  • [Patch] Add type definitions for cancel callback.

7.1.0

4 years ago

[7.1.0] - 2019-06-23

Added

  • [Minor] Added an option to directly import test from passable;
  • [Minor] any utility for assertions with OR || relationships.

7.0.0

5 years ago

[7.0.0] - 2019-06-11

Changed

  • [Major] Lowercased library name when imported on global object.
  • [Major] Renamed validationErrors and validationWarnings output properties to errors and warnings.
  • [Patch] Guarantee that .done() callbacks only run once.

Added

  • [Minor] .after() callback that can run after a specific field finished execution.
  • [Minor] New size rules (lessThan, greaterThan, lessThanOrEquals, greaterThanOrEquals, numberEquals, numberNotEquals).
  • [Minor] New size rules (longerThan, shorterThan, longerThanOrEquals, shorterThanOrEquals, lengthEquals, lengthNotEquals).
  • [Minor] New content rules (equals, notEquals).
  • [Minor] Support returning promise from test callback for async tests.
  • [Minor] Add cancel callback.

Removed

  • [Major] Removed output properties: hasValidationErrors, hasValidationWarnings.
  • [Major] Removed compound rules (anyOf, allOf, noneOf).
  • [Major] Removed general size rules (smallerThan, largerThan, smallerThanOrEquals, largerThanOrEquals, sizeEquals, sizeNotEquals).

6.3.3

5 years ago

Fixed documentation site

6.3.2

5 years ago
  • Reduced bundle size
  • Fixed es5 only browsers support