-
-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove need for pact-node in almost all uses, including examples
- Loading branch information
Showing
12 changed files
with
73 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* tslint:disable:no-unused-expression no-empty no-string-literal*/ | ||
import * as chai from "chai" | ||
import * as chaiAsPromised from "chai-as-promised" | ||
|
||
import { Publisher } from "./publisher" | ||
chai.use(chaiAsPromised) | ||
|
||
const expect = chai.expect | ||
|
||
describe("Publisher", () => { | ||
describe("#constructor", () => { | ||
it("constructs a valid Pubisher class", () => { | ||
const p = new Publisher({ | ||
consumerVersion: "1.0.0", | ||
pactBroker: "http://foo.com", | ||
pactFilesOrDirs: [], | ||
}) | ||
expect(p).to.have.nested.property("opts.consumerVersion") | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Pact Publisher service | ||
* @module Publisher | ||
*/ | ||
import { qToPromise } from "../common/utils" | ||
import publisher, { PublisherOptions } from "@pact-foundation/pact-node" | ||
|
||
export class Publisher { | ||
constructor(private opts: PublisherOptions) {} | ||
|
||
public publishPacts(): Promise<string[]> { | ||
return qToPromise<string[]>(publisher.publishPacts(this.opts)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters