@unito/integration-cli 1.0.0 → 1.0.1

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.
@@ -1786,10 +1786,11 @@
1786
1786
  }
1787
1787
  },
1788
1788
  "node_modules/flatted": {
1789
- "version": "3.3.1",
1790
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
1791
- "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
1792
- "dev": true
1789
+ "version": "3.4.1",
1790
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.1.tgz",
1791
+ "integrity": "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==",
1792
+ "dev": true,
1793
+ "license": "ISC"
1793
1794
  },
1794
1795
  "node_modules/form-data": {
1795
1796
  "version": "4.0.4",
@@ -88,6 +88,10 @@ class Test extends baseCommand_1.BaseCommand {
88
88
  allowNo: true,
89
89
  default: false,
90
90
  }),
91
+ port: core_1.Flags.integer({
92
+ description: 'port to run the integration on',
93
+ default: 9200,
94
+ }),
91
95
  };
92
96
  async catch(error) {
93
97
  /* istanbul ignore if */
@@ -159,7 +163,7 @@ class Test extends baseCommand_1.BaseCommand {
159
163
  // Launch the tests.
160
164
  const commandArguments = [
161
165
  `${process.env.NODE_MODULES_FOLDER}/@unito/integration-debugger/dist/src/index.js`,
162
- '--integration-url=http://localhost:9200',
166
+ `--integration-url=http://localhost:${flags.port}`,
163
167
  '--spawn-process=npm run dev',
164
168
  `--credential-payload=${credentialPayload}`,
165
169
  `--secrets-payload=${JSON.stringify(secrets)}`,
@@ -211,7 +215,7 @@ class Test extends baseCommand_1.BaseCommand {
211
215
  const child = child_process_1.default.spawn('node', commandArguments, {
212
216
  detached: true,
213
217
  stdio: 'inherit',
214
- env: { ...process.env, ...environmentVariables, NODE_ENV: 'development', PORT: '9200' },
218
+ env: { ...process.env, ...environmentVariables, NODE_ENV: 'development', PORT: String(flags.port) },
215
219
  });
216
220
  // istanbul ignore next
217
221
  child.on('exit', (code) => {
@@ -72,6 +72,15 @@ describe('Test', () => {
72
72
  .command(['test'])
73
73
  .exit(-1)
74
74
  .it('handled exception');
75
+ test_1.test
76
+ .stdout()
77
+ .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
78
+ .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
79
+ .command(['test', '--port=9300'])
80
+ .it('custom port', () => {
81
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--integration-url=http://localhost:9300');
82
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.PORT).to.equal('9300');
83
+ });
75
84
  test_1.test
76
85
  .stdout()
77
86
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
@@ -948,6 +948,14 @@
948
948
  "name": "skip-install",
949
949
  "allowNo": true,
950
950
  "type": "boolean"
951
+ },
952
+ "port": {
953
+ "description": "port to run the integration on",
954
+ "name": "port",
955
+ "default": 9200,
956
+ "hasDynamicHelp": false,
957
+ "multiple": false,
958
+ "type": "option"
951
959
  }
952
960
  },
953
961
  "hasDynamicHelp": false,
@@ -999,5 +1007,5 @@
999
1007
  ]
1000
1008
  }
1001
1009
  },
1002
- "version": "1.0.0"
1010
+ "version": "1.0.1"
1003
1011
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Integration CLI",
5
5
  "bin": {
6
6
  "integration-cli": "./bin/run"