Skip to content

Commit 6afc281

Browse files
author
Ronald Holshausen
committed
chore: add the V3 E2E tests to travis build
1 parent 9ea3dea commit 6afc281

File tree

9 files changed

+28
-12
lines changed

9 files changed

+28
-12
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage/
2+

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ matrix:
1919
env:
2020
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
2121
- os: osx
22-
osx_image: xcode8
2322
env:
2423
- MATRIX_EVAL="brew install gcc5 && CC=gcc-5 && CXX=g++-5"
2524
cache:

examples/v3/e2e/test/consumer.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require("path")
22
const chai = require("chai")
33
const chaiAsPromised = require("chai-as-promised")
44
const expect = chai.expect
5-
const { PactV3, Matchers } = require("@pact-foundation/pact/v3")
5+
const { PactV3, MatchersV3 } = require("@pact-foundation/pact/v3")
66
const LOG_LEVEL = process.env.LOG_LEVEL || "WARN"
77

88
chai.use(chaiAsPromised)
@@ -18,7 +18,7 @@ describe("Pact V3", () => {
1818
string,
1919
regex,
2020
like,
21-
} = Matchers
21+
} = MatchersV3
2222

2323
// Animal we want to match :)
2424
const suitor = {

examples/v3/todo-consumer/test/consumer.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const path = require("path")
22
const chai = require("chai")
33
const chaiAsPromised = require("chai-as-promised")
4-
const { PactV3, Matchers, XmlBuilder } = require("@pact-foundation/pact/v3")
4+
const { PactV3, MatchersV3, XmlBuilder } = require("@pact-foundation/pact/v3")
55
const {
66
string,
77
eachLike,
88
integer,
99
boolean,
1010
atLeastOneLike,
1111
timestamp,
12-
} = Matchers
12+
} = MatchersV3
1313

1414
const TodoApp = require("../src/todo")
1515

examples/v3/todo-consumer/test/provider.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const {
22
PactV3,
3-
Matchers,
3+
MatchersV3,
44
XmlBuilder,
55
VerifierV3,
66
} = require("@pact-foundation/pact/v3")

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"deploy:prepare": "./scripts/create_npmrc_file.sh",
1515
"dist": "npm run compile && webpack --config ./config/webpack.web.config.js",
1616
"jscpd": "jscpd -p src -r json -o jscpd.json",
17-
"lint": "npm run lint:prettier:ts && npm run lint:prettier:js #&& tslint -c tslint.json '{src,test,examples}/**/*.ts' -e '**/node_modules/**/*.ts'",
17+
"lint": "npm run lint:prettier:ts && npm run lint:prettier:js",
1818
"lint:fix": "prettier --parser typescript --write \"{src,test,examples}/**/*.ts\" && prettier --write \"{src,test,examples}/**/*.js\"",
1919
"lint:prettier:ts": "prettier --parser typescript --check \"{src,test,examples}/**/*.ts\"",
2020
"lint:prettier:js": "prettier --check \"{src,test,examples}/**/*.js\"",

scripts/build.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ for i in examples/*; do
1515
[ -e "$i" ] || [$i == "v3"] || continue # prevent failure if there are no examples
1616
echo "------------------------------------------------"
1717
echo "------------> continuing to test example project: $i"
18-
cd "$i"
18+
pushd "$i"
1919
if [[ "$i" =~ "karma" ]]; then
2020
echo "linking pact-web"
2121
npm link @pact-foundation/pact-web
@@ -24,5 +24,18 @@ for i in examples/*; do
2424
npm link @pact-foundation/pact
2525
fi
2626
npm it
27-
cd ../../
27+
popd
28+
done
29+
30+
echo "Running V3 e2e examples build for node version ${TRAVIS_NODE_VERSION}"
31+
for i in examples/v3/*; do
32+
[ -e "$i" ] || continue # prevent failure if there are no examples
33+
echo "------------------------------------------------"
34+
echo "------------> continuing to test V3 example project: $i"
35+
pushd "$i"
36+
npm i
37+
echo "linking pact"
38+
npm link @pact-foundation/pact
39+
npm t
40+
popd
2841
done

src/pact.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,5 @@ export * from "./dsl/interaction"
7474
* @static
7575
*/
7676
export * from "./dsl/mockService"
77+
78+
export * from "./v3"

src/v3/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ PactNative.init()
55
export * from "./pact"
66

77
/**
8-
* Exposes {@link Matchers}
8+
* Exposes {@link MatchersV3}
99
* To avoid polluting the root module's namespace, re-export
1010
* Matchers as its owns module
1111
* @memberof Pact
1212
* @static
1313
*/
14-
import * as Matchers from "./matchers"
15-
export import Matchers = Matchers
14+
import * as MatchersV3 from "./matchers"
15+
export import MatchersV3 = MatchersV3
1616

1717
/**
1818
* Exposes {@link VerifierV3}

0 commit comments

Comments
 (0)