Skip to content

Releases: case-contract-testing/contract-case

v0.7.0

07 Apr 14:08
d62c3f9
Compare
Choose a tag to compare

0.7.0 (2023-04-07)

⚠ BREAKING CHANGES

  • Rename the verifier options triggers.verifiers to triggers.testResponses and triggers.errorVerifiers to triggers.testErrorResponses for consistency with the runExample DSL
  • Rename contract.verifyContract to contract.runVerification for consistency
  • Verification now supports reading contracts from a directory, to allow contract download from a broker. The interface to verifyContract has now changed - use contractFilename or contractDirectory instead of passing the raw contract.
  • Change the default to not publish contracts if not in CI. Set the new config option publish: true or publish: "ALWAYS" if you need the old behaviour of always publishing
  • All matcher and mock types are now prefixed with case:. This change allows extensions without naming clashes, but means any contracts prior to this version must be regenerated.

Features

  • Add ability to publish verification results (cc2b7c2)
  • Change the default to not publish contracts if not in CI. Set the new config option publish: true or publish: "ALWAYS" if you need the old behaviour of always publishing (9ab6ca9)
  • Print broker response messages (093d896)
  • Verification now supports reading contracts from a directory, to allow contract download from a broker. The interface to verifyContract has now changed - use contractFilename or contractDirectory instead of passing the raw contract. (e0b9fbb)
  • When saving contracts, create contract directory if it doesn't already exist (72f8edb)

Bug Fixes

  • Correct parsing of Broker response messages (f625168)
  • Empty triggers.testResponses and triggers.testErrorResponses blocks are no longer required (4a2d6e6)
  • Extend Jest's timeout during contract definition as well as verification (db998a6)
  • Improve debug message when the trigger fails (098050a)
  • Improve error message when publish is misconfigured (fc0fb1e)

Code Refactoring

  • All matcher and mock types are now prefixed with case:. This change allows extensions without naming clashes, but means any contracts prior to this version must be regenerated. (945808b)
  • Rename contract.verifyContract to contract.runVerification for consistency (b739ceb)
  • Rename the verifier options triggers.verifiers to triggers.testResponses and triggers.errorVerifiers to triggers.testErrorResponses for consistency with the runExample DSL (a6fe848)

v0.6.2

28 Mar 12:26
fb2f68c
Compare
Choose a tag to compare

0.6.2 (2023-03-28)

Features

  • Add stringifiedJson and encodedStringBase64 matchers (5e992e7)
  • Use the advanced broker publishing endpoint instead of the old one (070aee8)

Miscellaneous Chores

v0.6.1

27 Mar 05:52
779b24d
Compare
Choose a tag to compare

0.6.1 (2023-03-27)

Bug Fixes

  • Tidy up boundary layer to improve importing in JSii (6604996)

Miscellaneous Chores

v0.6.0

26 Mar 17:05
103a63c
Compare
Choose a tag to compare

0.6.0 (2023-03-26)

⚠ BREAKING CHANGES

  • Verification no longer throws an error if verification fails. The intended use is to use can-i-deploy to gate deployments. If you need failure (eg during development), set throwOnFail: true in the options.

Features

  • Verification no longer throws an error if verification fails. The intended use is to use can-i-deploy to gate deployments. If you need failure (eg during development), set throwOnFail: true in the options. (ee33690)

Bug Fixes

  • Add location information to title of the errors, improving readability (1f740d9)
  • Correct location string in the suffix matcher during describe (was incorrectly "prefix") (a52efca)
  • Improve formatting of the thrown error when the assertions fail (3a50dad)
  • Rename 'Test' -> 'Example' in the location tag printed in errors (e8bddf6)
  • Substantially reduce the verbosity of the location hint in errors (unless logLevel is maintainerDebug or lower) (63f3413)

v0.5.1

21 Mar 12:40
558968d
Compare
Choose a tag to compare

0.5.1 (2023-03-21)

Features

  • jest: Use contract consumerName and providerName in describe block during contract validation (9763035)

Bug Fixes

  • Remove an empty describe block present during contract verification in Jest (e01070e)

Miscellaneous Chores

v0.5.0

21 Mar 06:07
3993bfc
Compare
Choose a tag to compare

0.5.0 (2023-03-21)

⚠ BREAKING CHANGES

  • Remove misnamed exports of CaseContract and CaseVerifier. Use the intended classes ContractDefiner and ContractVerifier instead
  • Rename VerifiyCaseJestCallback -> VerifyCaseJestCallback, fixing a typo in the name

Features

  • Add ability to override config on a per-test level using an optional config parameter for runExample() and runRejectingExample() (d3fe7de)
  • Add bearerToken() matcher for ease of auth headers; and a stringStateVariable() matcher for use when you know a variable is a string (f9fa501)
  • Add download-contracts binary which can download contracts from a broker (7c73360)
  • Add uriEncodedString() matcher for URI encoded strings (de7bdea)
  • docs: Defining contract documentation now written (ab894ff)
  • Expose config to test reponse functions during contract definition (d237618)
  • Support the Open Source Pact Broker by adding basic auth. Also added a basicAuth() matcher (997c3ab)

Bug Fixes

  • Correct typo in httpStatus human-readable string (httpStaus -> httpStatus) (70e44af)
  • Don't try to publish a contract if there's no CI token set; instead just print a warning (564aa6e)
  • Fix a bug where it was possible to have a failed test ignored instead of leading to failure to write the contract (757ebf8)
  • Increase timeout for verifications in Jest to 30 seconds (ce800c2)
  • Loosen type restriction when using variables from Config objects (f8918d9)
  • Remove hack to match Pact file format as it is now not necessary (30ddd7f)
  • Remove misnamed exports of CaseContract and CaseVerifier. Use the intended classes ContractDefiner and ContractVerifier instead (5cd77aa)
  • Rename VerifiyCaseJestCallback -> VerifyCaseJestCallback, fixing a typo in the name (d69c4b2)

v0.4.0

17 Mar 07:12
c3da951
Compare
Choose a tag to compare

0.4.0 (2023-03-17)

⚠ BREAKING CHANGES

  • Rename ContractFile type ContractData

Features

  • Add case version metadata to contract file (479c27b)

Code Refactoring

  • Rename ContractFile type ContractData (0329b6c)

v0.3.0

07 Mar 13:38
4207da4
Compare
Choose a tag to compare

0.3.0 (2023-03-07)

⚠ BREAKING CHANGES

  • Change the automatic description of variables from ${varName} to {{varName}}
  • jest: Add verifyContract helper; rename caseContractWith to defineContract for consistency

Features

  • Add ability to pass common config (statehandlers and triggers) to the contract at initialisation (e30fe34)
  • jest: Add verifyContract helper; rename caseContractWith to defineContract for consistency (a035fc7)
  • Support query strings in http tests (0909b4c)

Bug Fixes

  • Change the automatic description of variables from ${varName} to {{varName}} (eecab14)
  • Print name of error instead of 'EXECUTION ERROR' when an execution error happens (30610e5)

v0.2.0

06 Mar 08:55
1e73fb7
Compare
Choose a tag to compare

0.2.0 (2023-03-06)

⚠ BREAKING CHANGES

  • Remove info log level as it was never needed

Features

  • Add ability to specifiy exact contract filename (7ccf8de)
  • Add deepMaintainerDebug log level (673c3c2)
  • Add native broker client (465cf44)
  • Allow files to be uploaded to Pact Brokers (4879b35)
  • Extract Jest DSL for writing contracts (a56bb1e)

Bug Fixes

  • Add Jest as a peer-dependency (a48e861)
  • Connect state variables to the config object that handlers receive (76e4e49)
  • Don't log the config in the contract file (4cf3922)
  • Ensure that version number in logs is always correct (672301f)
  • ensure the Assertable promise isn't left open if a trigger function fails (7a6270d)
  • Expose typescript types in compiled package (0ad7502)
  • Remove info log level as it was never needed (b6801b6)
  • Substantially improve error message when the verification of a trigger return object fails (085df9b)
  • upgrade axios from 1.3.1 to 1.3.2 (c98b4a6)
  • upgrade pretty-format from 29.3.1 to 29.4.1 (951696e)