Skip to content

Commit

Permalink
fix(package-name): Use the new name (pact-core) for pact-node
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyJones committed Mar 5, 2021
1 parent 88b4d9c commit a42fee2
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 62 deletions.
74 changes: 37 additions & 37 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/karma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"license": "MIT",
"devDependencies": {
"@pact-foundation/karma-pact": "^2.3.1",
"@pact-foundation/pact-node": "^10.11.1",
"@pact-foundation/pact-core": "^10.12.0",
"@pact-foundation/pact-web": "^8.2.6",
"chai": "^4.2.0",
"karma": "5.2.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/test/helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import wrapper from "@pact-foundation/pact-node"
import wrapper from "@pact-foundation/pact-core"

// used to kill any left over mock server instances
process.on("SIGINT", () => {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
]
},
"dependencies": {
"@pact-foundation/pact-node": "^10.11.11",
"@pact-foundation/pact-core": "^10.12.0",
"@types/bluebird": "^3.5.20",
"@types/express": "^4.17.11",
"bluebird": "~3.5.1",
Expand Down
2 changes: 1 addition & 1 deletion src/dsl/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
import { PactfileWriteMode } from "./mockService"
import { MessageProviders, StateHandlers } from "../pact"
import { VerifierOptions as PactNodeVerifierOptions } from "@pact-foundation/pact-node"
import { VerifierOptions as PactNodeVerifierOptions } from "@pact-foundation/pact-core"

export type LogLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal"

Expand Down
2 changes: 1 addition & 1 deletion src/dsl/publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @module Publisher
*/
import { qToPromise } from "../common/utils"
import publisher, { PublisherOptions } from "@pact-foundation/pact-node"
import publisher, { PublisherOptions } from "@pact-foundation/pact-core"

export class Publisher {
constructor(private opts: PublisherOptions) {}
Expand Down
2 changes: 1 addition & 1 deletion src/dsl/verifier.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as chai from "chai"
import * as chaiAsPromised from "chai-as-promised"
import * as sinon from "sinon"
import { Verifier, VerifierOptions } from "./verifier"
import serviceFactory from "@pact-foundation/pact-node"
import serviceFactory from "@pact-foundation/pact-core"
import logger from "../common/logger"
import * as http from "http"
import * as express from "express"
Expand Down
6 changes: 3 additions & 3 deletions src/dsl/verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Provider Verifier service
* @module ProviderVerifier
*/
import pact from "@pact-foundation/pact-node"
import pact from "@pact-foundation/pact-core"
import { qToPromise } from "../common/utils"
import { VerifierOptions as PactNodeVerifierOptions } from "@pact-foundation/pact-node"
import serviceFactory from "@pact-foundation/pact-node"
import { VerifierOptions as PactNodeVerifierOptions } from "@pact-foundation/pact-core"
import serviceFactory from "@pact-foundation/pact-core"
import { omit, isEmpty, pickBy, identity, reduce } from "lodash"
import * as express from "express"
import * as http from "http"
Expand Down
10 changes: 5 additions & 5 deletions src/httpPact.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { HTTPMethod } from "./common/request"
import { Interaction, InteractionObject } from "./dsl/interaction"
import { MockService } from "./dsl/mockService"
import { PactOptions, PactOptionsComplete } from "./dsl/options"
import serviceFactory from "@pact-foundation/pact-node"
import serviceFactory from "@pact-foundation/pact-core"
import { Pact } from "./httpPact"
import { ImportMock } from "ts-mock-imports"

Expand Down Expand Up @@ -38,7 +38,7 @@ describe("Pact", () => {
} as PactOptionsComplete

before(() => {
// Stub out pact-node
// Stub out pact-core
const manager = ImportMock.mockClass(serviceFactory, "createServer") as any
manager.mock("createServer", () => {})
})
Expand Down Expand Up @@ -98,17 +98,17 @@ describe("Pact", () => {
}

describe("when server is not properly configured", () => {
describe("and pact-node is unable to start the server", () => {
describe("and pact-core is unable to start the server", () => {
it("returns a rejected promise", async () => {
const p: any = new Pact(fullOpts)

p.server = {
start: () => Promise.reject("pact-node error"),
start: () => Promise.reject("pact-core error"),
options: { port: 1234 },
}

return expect(p.setup()).to.eventually.be.rejectedWith(
"pact-node error"
"pact-core error"
)
})
})
Expand Down
4 changes: 2 additions & 2 deletions src/httpPact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import serviceFactory from "@pact-foundation/pact-node"
import serviceFactory from "@pact-foundation/pact-core"
import * as path from "path"
import * as clc from "cli-color"
import * as process from "process"
Expand All @@ -8,7 +8,7 @@ import { isPortAvailable } from "./common/net"
import logger, { traceHttpInteractions, setLogLevel } from "./common/logger"
import { MockService } from "./dsl/mockService"
import { LogLevel, PactOptions, PactOptionsComplete } from "./dsl/options"
import { Server } from "@pact-foundation/pact-node/src/server"
import { Server } from "@pact-foundation/pact-core/src/server"
import VerificationError from "./errors/verificationError"
import ConfigurationError from "./errors/configurationError"

Expand Down
2 changes: 1 addition & 1 deletion src/messageConsumerPact.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe("MessageConsumer", () => {
})

describe("#getServiceFactory", () => {
it("returns a valid pact-node object", () => {
it("returns a valid pact-core object", () => {
const serviceFactory = (consumer as any).getServiceFactory()
expect(serviceFactory).to.be.a("object")
expect(serviceFactory).to.respondTo("createMessage")
Expand Down
2 changes: 1 addition & 1 deletion src/messageConsumerPact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
MessageConsumer,
} from "./dsl/message"
import logger, { setLogLevel } from "./common/logger"
import serviceFactory from "@pact-foundation/pact-node"
import serviceFactory from "@pact-foundation/pact-core"
import { MessageConsumerOptions } from "./dsl/options"
import ConfigurationError from "./errors/configurationError"

Expand Down
3 changes: 1 addition & 2 deletions src/messageProviderPact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import { omit, isEmpty } from "lodash"
import { MessageDescriptor } from "./dsl/message"
import logger, { setLogLevel } from "./common/logger"
import { VerifierOptions } from "@pact-foundation/pact-node"
import serviceFactory, { VerifierOptions } from "@pact-foundation/pact-core"
import { PactMessageProviderOptions } from "./dsl/options"
import serviceFactory from "@pact-foundation/pact-node"
import * as express from "express"
import * as http from "http"
import { MessageProvider } from "./pact"
Expand Down
2 changes: 1 addition & 1 deletion test/helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict"

import pact from "@pact-foundation/pact-node"
import pact from "@pact-foundation/pact-core"

// used to kill any left over mock server instances
process.on("SIGINT", () => {
Expand Down

0 comments on commit a42fee2

Please sign in to comment.