pmpact 0.3.15 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +11 -11
- package/pmpact.js +1 -1
- package/tests/integration/simple-usage.js +8 -8
- package/tests/unit/pmpact.js +2 -2
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ A command line tool to convert [*Pact*](https://docs.pact.io/) files to [*Postma
|
|
|
24
24
|
|
|
25
25
|
## Requirements
|
|
26
26
|
|
|
27
|
-
Requires [*NodeJS*](https://nodejs.org/en/) version `
|
|
27
|
+
Requires [*NodeJS*](https://nodejs.org/en/) version `v18.16.0` or higher.
|
|
28
28
|
|
|
29
29
|
## Installation
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmpact",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A command line tool to convert Pact files to Postman collections.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"convert"
|
|
22
22
|
],
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">=18.16.0"
|
|
25
25
|
},
|
|
26
26
|
"author": "Romuald Quantin (ITV)",
|
|
27
27
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/ITV/pmpact#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"axios": "0.
|
|
34
|
-
"commander": "
|
|
35
|
-
"debug": "3.
|
|
36
|
-
"http-status": "1.
|
|
33
|
+
"axios": "0.27.2",
|
|
34
|
+
"commander": "4.1.1",
|
|
35
|
+
"debug": "4.3.4",
|
|
36
|
+
"http-status": "1.6.2",
|
|
37
37
|
"lodash": "4.17.21"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"chai": "4.
|
|
41
|
-
"execa": "1.
|
|
42
|
-
"mocha": "10.
|
|
40
|
+
"chai": "4.3.7",
|
|
41
|
+
"execa": "5.1.1",
|
|
42
|
+
"mocha": "10.2.0",
|
|
43
43
|
"mocha-better-spec-reporter": "3.1.0",
|
|
44
|
-
"proxyquire": "2.1.
|
|
45
|
-
"sinon": "
|
|
44
|
+
"proxyquire": "2.1.3",
|
|
45
|
+
"sinon": "15.0.3"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/pmpact.js
CHANGED
|
@@ -29,7 +29,7 @@ describe('pmpact integration', () => {
|
|
|
29
29
|
|
|
30
30
|
afterEach(async () => {
|
|
31
31
|
try {
|
|
32
|
-
await execa
|
|
32
|
+
await execa(`rm -f ${FILE_OUTPUT_TEST}`, undefined, { shell: true })
|
|
33
33
|
if (server) {
|
|
34
34
|
await createServerClosePromise(server);
|
|
35
35
|
server = undefined;
|
|
@@ -41,7 +41,7 @@ describe('pmpact integration', () => {
|
|
|
41
41
|
|
|
42
42
|
it('should parse a file', async () => {
|
|
43
43
|
try {
|
|
44
|
-
const { stdout, stderr } = await execa
|
|
44
|
+
const { stdout, stderr } = await execa('node pmpact.js tests/fixtures/v2/simple-pact.json', undefined, { shell: true });
|
|
45
45
|
assert.ok(isPostmanCollection(stdout));
|
|
46
46
|
assert.equal(stderr, '');
|
|
47
47
|
} catch(err) {
|
|
@@ -57,7 +57,7 @@ describe('pmpact integration', () => {
|
|
|
57
57
|
res.end(JSON.stringify(simplePactJson));
|
|
58
58
|
});
|
|
59
59
|
server.listen(9012);
|
|
60
|
-
const { stdout, stderr } = await execa
|
|
60
|
+
const { stdout, stderr } = await execa('node pmpact.js http://localhost:9012', undefined, { shell: true });
|
|
61
61
|
assert.ok(isPostmanCollection(stdout));
|
|
62
62
|
assert.equal(stderr, '');
|
|
63
63
|
} catch(err) {
|
|
@@ -75,7 +75,7 @@ describe('pmpact integration', () => {
|
|
|
75
75
|
res.end(JSON.stringify(simplePactJson));
|
|
76
76
|
});
|
|
77
77
|
server.listen(9012);
|
|
78
|
-
const { stdout, stderr } = await execa
|
|
78
|
+
const { stdout, stderr } = await execa('node pmpact.js http://localhost:9012 -H \'{"Authorization":"Basic ZFhmbHR5Rk1n..."}\'', undefined, { shell: true });
|
|
79
79
|
assert.ok(isPostmanCollection(stdout));
|
|
80
80
|
assert.equal(headerAuth, 'Basic ZFhmbHR5Rk1n...');
|
|
81
81
|
assert.equal(stderr, '');
|
|
@@ -87,7 +87,7 @@ describe('pmpact integration', () => {
|
|
|
87
87
|
|
|
88
88
|
it('should save to an output', async () => {
|
|
89
89
|
try {
|
|
90
|
-
const { stdout, stderr } = await execa
|
|
90
|
+
const { stdout, stderr } = await execa(`node pmpact.js tests/fixtures/v2/simple-pact.json -o ${FILE_OUTPUT_TEST}`, undefined, { shell: true });
|
|
91
91
|
assert.ok(stdout.indexOf('The collection has been successfully written') !== -1);
|
|
92
92
|
const contentJson = (await readFile(FILE_OUTPUT_TEST)).toString('utf8');
|
|
93
93
|
assert.ok(isPostmanCollection(contentJson));
|
|
@@ -100,11 +100,11 @@ describe('pmpact integration', () => {
|
|
|
100
100
|
|
|
101
101
|
it('should exit with a proper exit code', async () => {
|
|
102
102
|
try {
|
|
103
|
-
await execa
|
|
103
|
+
await execa('node pmpact.js non-existing-file.json', undefined, { shell: true });
|
|
104
104
|
assert.ok(0, 'Should not be successful');
|
|
105
105
|
} catch(err) {
|
|
106
|
-
assert.ok(err.
|
|
106
|
+
assert.ok(err.exitCode > 0);
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
});
|
|
110
|
+
});
|
package/tests/unit/pmpact.js
CHANGED
|
@@ -32,8 +32,8 @@ describe('pmpact', () => {
|
|
|
32
32
|
commanderStub.action = (handler) => {
|
|
33
33
|
actionHandler = handler;
|
|
34
34
|
}
|
|
35
|
-
commanderStub.args = [];
|
|
36
35
|
applicationStub = function(){};
|
|
36
|
+
commanderStub.rawArgs = [];
|
|
37
37
|
applicationStub.prototype.parse = sinon.spy();
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -121,4 +121,4 @@ describe('pmpact', () => {
|
|
|
121
121
|
assert.ok(console.error.withArgs(error).calledOnce);
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
});
|
|
124
|
+
});
|