pmpact 0.3.14 → 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 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 `v7.10.1` or higher.
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.14",
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": ">=7.10.1"
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.21.2",
34
- "commander": "2.17.1",
35
- "debug": "3.1.0",
36
- "http-status": "1.4.2",
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.2.0",
41
- "execa": "1.0.0",
42
- "mocha": "8.1.1",
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.0",
45
- "sinon": "7.2.3"
44
+ "proxyquire": "2.1.3",
45
+ "sinon": "15.0.3"
46
46
  }
47
47
  }
package/pmpact.js CHANGED
@@ -44,7 +44,7 @@ program.on('--help', () => {
44
44
 
45
45
  program.parse(process.argv);
46
46
 
47
- const NO_COMMAND = program.args.length === 0;
47
+ const NO_COMMAND = program.rawArgs.length < 3;
48
48
 
49
49
  if (NO_COMMAND) {
50
50
  program.help();
@@ -29,7 +29,7 @@ describe('pmpact integration', () => {
29
29
 
30
30
  afterEach(async () => {
31
31
  try {
32
- await execa.shell(`rm -f ${FILE_OUTPUT_TEST}`)
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.shell('node pmpact.js tests/fixtures/v2/simple-pact.json');
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.shell('node pmpact.js http://localhost:9012');
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.shell('node pmpact.js http://localhost:9012 -H \'{"Authorization":"Basic ZFhmbHR5Rk1n..."}\'');
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.shell(`node pmpact.js tests/fixtures/v2/simple-pact.json -o ${FILE_OUTPUT_TEST}`);
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.shell('node pmpact.js non-existing-file.json');
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.code > 0);
106
+ assert.ok(err.exitCode > 0);
107
107
  }
108
108
  });
109
109
 
110
- });
110
+ });
@@ -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
+ });