@pact-foundation/pact
Advanced tools
Comparing version 9.5.1 to 9.6.0
@@ -1,12 +0,16 @@ | ||
# Changelog | ||
# Change Log | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
### [9.5.1](https://github.com/pact-foundation/pact-js/compare/v9.5.0...v9.5.1) (2019-12-13) | ||
<a name="9.6.0"></a> | ||
# [9.6.0](https://github.com/pact-foundation/pact-js/compare/v9.5.1...v9.6.0) (2020-01-01) | ||
### Bug Fixes | ||
### Features | ||
* **pact-node:** Bump pact-node to ^10.2.3, which allows quotes in provider/consumer names (fixes [#160](https://github.com/pact-foundation/pact-js/issues/160)) ([acc5e7f](https://github.com/pact-foundation/pact-js/commit/acc5e7f8e7b2be0a2ce3f5476b164bcb2cf2f731)) | ||
* add email address matcher ([14e8974](https://github.com/pact-foundation/pact-js/commit/14e8974)) | ||
* **email:** add simplified email address format ([f5ea38e](https://github.com/pact-foundation/pact-js/commit/f5ea38e)) | ||
<a name="9.5.0"></a> | ||
@@ -13,0 +17,0 @@ # [9.5.0](https://github.com/pact-foundation/pact-js/compare/v9.4.0...v9.5.0) (2019-11-10) |
@@ -6,2 +6,3 @@ /** @module Matchers | ||
*/ | ||
export declare const EMAIL_FORMAT = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$"; | ||
export declare const ISO8601_DATE_FORMAT = "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))?)$"; | ||
@@ -68,2 +69,18 @@ export declare const ISO8601_DATETIME_FORMAT = "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$"; | ||
/** | ||
* Email address matcher. | ||
* @param {string} address - a email address to use as an example | ||
*/ | ||
export declare function email(address?: string): { | ||
data: { | ||
generate: string; | ||
matcher: { | ||
json_class: string; | ||
o: number; | ||
s: string; | ||
}; | ||
}; | ||
getValue: () => string; | ||
json_class: string; | ||
}; | ||
/** | ||
* UUID v4 matcher. | ||
@@ -70,0 +87,0 @@ * @param {string} uuuid - a UUID to use as an example. |
@@ -13,2 +13,3 @@ "use strict"; | ||
/* tslint:disable:max-line-length */ | ||
exports.EMAIL_FORMAT = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$"; | ||
exports.ISO8601_DATE_FORMAT = "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))?)$"; | ||
@@ -114,2 +115,13 @@ exports.ISO8601_DATETIME_FORMAT = "^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)$"; | ||
/** | ||
* Email address matcher. | ||
* @param {string} address - a email address to use as an example | ||
*/ | ||
function email(address) { | ||
return term({ | ||
generate: address || "hello@pact.io", | ||
matcher: exports.EMAIL_FORMAT, | ||
}); | ||
} | ||
exports.email = email; | ||
/** | ||
* UUID v4 matcher. | ||
@@ -247,3 +259,3 @@ * @param {string} uuuid - a UUID to use as an example. | ||
function isMatcher(x) { | ||
return x.getValue !== undefined; | ||
return x != null && x.getValue !== undefined; | ||
} | ||
@@ -250,0 +262,0 @@ exports.isMatcher = isMatcher; |
@@ -295,2 +295,19 @@ "use strict"; | ||
}); | ||
describe("#email", function () { | ||
describe("when given a valid Email address", function () { | ||
it("creates a valid matcher", function () { | ||
expect(matchers_1.email("hello@world.com")).to.be.an("object"); | ||
expect(matchers_1.email("hello@world.com.au")).to.be.an("object"); | ||
expect(matchers_1.email("hello@a.co")).to.be.an("object"); | ||
expect(matchers_1.email()).to.be.an("object"); | ||
}); | ||
}); | ||
describe("when given an invalid Email address", function () { | ||
it("returns an error", function () { | ||
expect(function () { | ||
matchers_1.email("hello.world.c"); | ||
}).to.throw(Error); | ||
}); | ||
}); | ||
}); | ||
describe("#uuid", function () { | ||
@@ -297,0 +314,0 @@ describe("when given a valid UUID", function () { |
{ | ||
"name": "@pact-foundation/pact", | ||
"version": "9.5.1", | ||
"version": "9.6.0", | ||
"description": "Pact for all things Javascript", | ||
@@ -5,0 +5,0 @@ "main": "./pact.js", |
@@ -625,2 +625,3 @@ # Pact JS | ||
| `uuid` | Will match strings containing UUIDs | | ||
| `email` | Will match strings containing Email address | | ||
@@ -627,0 +628,0 @@ </details> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
433238
5357
1037