postman-runtime 7.26.3-beta.1 → 7.26.5

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.
Files changed (64) hide show
  1. package/.github/dependabot.yml +11 -0
  2. package/.travis.yml +4 -0
  3. package/CHANGELOG.yaml +18 -0
  4. package/dist/index.js +30 -32
  5. package/lib/authorizer/oauth1.js +13 -3
  6. package/lib/authorizer/oauth2.js +5 -2
  7. package/lib/runner/extensions/event.command.js +1 -1
  8. package/npm/dist.js +39 -0
  9. package/package.json +16 -13
  10. package/test/integration/auth-methods/digest.test.js +1 -1
  11. package/test/integration/auth-methods/ntlm.test.js +1 -1
  12. package/test/integration/auth-methods/oauth1.test.js +6 -3
  13. package/test/integration/benchmark/large-response.test.js +1 -1
  14. package/test/integration/bootstrap.js +0 -1
  15. package/test/integration/file-uploads/request-body.test.js +17 -8
  16. package/test/integration/protocol-profile-behavior/disableBodyPruning.test.js +11 -5
  17. package/test/integration/protocol-profile-behavior/disabledSystemHeaders.test.js +1 -1
  18. package/test/integration/protocol-profile-behavior/sanity.test.js +1 -1
  19. package/test/integration/request-body/form-data.test.js +9 -4
  20. package/test/integration/request-flow/headers.test.js +1 -1
  21. package/test/integration/request-flow/intermediate-requests.test.js +2 -1
  22. package/test/integration/request-flow/invalid-url.test.js +1 -1
  23. package/test/integration/request-flow/ipv6-localhost.test.js +1 -1
  24. package/test/integration/request-flow/pm-send-request-cookies.test.js +1 -1
  25. package/test/integration/request-flow/requests-from-sandbox.test.js +3 -2
  26. package/test/integration/request-flow/response-cookies.test.js +1 -1
  27. package/test/integration/request-flow/unicode-url.test.js +1 -1
  28. package/test/integration/request-flow/url-encoding.test.js +1 -1
  29. package/test/integration/requester-spec/agents.test.js +1 -1
  30. package/test/integration/requester-spec/extendedRootCA.test.js +1 -1
  31. package/test/integration/requester-spec/history.test.js +1 -1
  32. package/test/integration/requester-spec/maxResponseSize.test.js +1 -1
  33. package/test/integration/requester-spec/redirect.test.js +1 -1
  34. package/test/integration/requester-spec/timing.test.js +1 -1
  35. package/test/integration/requester-spec/useWhatWGUrlParser.test.js +1 -1
  36. package/test/integration/runner-spec/ignoreProxySystemVariables.test.js +1 -1
  37. package/test/integration/sandbox-libraries/pm.test.js +8 -4
  38. package/test/integration/sanity/certificate.test.js +1 -1
  39. package/test/integration/sanity/content-type-in-form-data.test.js +1 -1
  40. package/test/integration/sanity/cookie-handling.test.js +1 -1
  41. package/test/integration/sanity/dns-lookup.test.js +1 -1
  42. package/test/integration/sanity/econnrefused.test.js +1 -1
  43. package/test/integration/sanity/file-uploads.test.js +1 -1
  44. package/test/integration/sanity/form-data-order.test.js +1 -1
  45. package/test/integration/sanity/http-methods.test.js +6 -3
  46. package/test/integration/sanity/http-reason-phrases.test.js +1 -1
  47. package/test/integration/sanity/multi-value-response-headers.test.js +1 -1
  48. package/test/integration/sanity/proxy-http-vars.test.js +1 -1
  49. package/test/integration/sanity/proxy-http.test.js +1 -1
  50. package/test/integration/sanity/redirect.test.js +6 -3
  51. package/test/integration/sanity/request-size.test.js +1 -1
  52. package/test/integration/sanity/response-status-message.test.js +1 -1
  53. package/test/integration/sanity/restricted-addresses.test.js +1 -1
  54. package/test/integration/sanity/script-result.test.js +1 -1
  55. package/test/integration/sanity/server-ssl.test.js +1 -1
  56. package/test/integration/sanity/systemproxy.test.js +1 -1
  57. package/test/integration/sanity/timeouts/request.test.js +1 -1
  58. package/test/integration/sanity/timeouts/sync-scripts.test.js +1 -1
  59. package/test/integration/sanity/uvm-globals-this.test.js +1 -1
  60. package/test/integration/sanity/v2-regression.test.js +1 -1
  61. package/test/karma.conf.js +2 -2
  62. package/test/system/repository.test.js +11 -2
  63. package/test/unit/auth-handlers.test.js +114 -0
  64. package/test/unit/version.test.js +1 -1
@@ -276,15 +276,25 @@ module.exports = {
276
276
  {system: true, key: OAUTH1_PARAMS.oauthSignatureMethod, value: params.signatureMethod},
277
277
  {system: true, key: OAUTH1_PARAMS.oauthTimestamp, value: params.timestamp},
278
278
  {system: true, key: OAUTH1_PARAMS.oauthNonce, value: params.nonce},
279
- {system: true, key: OAUTH1_PARAMS.oauthVersion, value: params.version},
280
- {system: true, key: OAUTH1_PARAMS.oauthCallback, value: params.callback},
281
- {system: true, key: OAUTH1_PARAMS.oauthVerifier, value: params.verifier}
279
+ {system: true, key: OAUTH1_PARAMS.oauthVersion, value: params.version}
282
280
  ];
283
281
 
282
+ // bodyHash, callback and verifier parameters are part of extensions of the original OAuth1 spec.
283
+ // So we only include those in signature if they are non-empty, ignoring the addEmptyParamsToSign setting.
284
+ // Otherwise it causes problem for servers that don't support the respective OAuth1 extensions.
285
+ // Issue: https://github.com/postmanlabs/postman-app-support/issues/8737
284
286
  if (params.bodyHash) {
285
287
  signatureParams.push({system: true, key: OAUTH1_PARAMS.oauthBodyHash, value: params.bodyHash});
286
288
  }
287
289
 
290
+ if (params.callback) {
291
+ signatureParams.push({system: true, key: OAUTH1_PARAMS.oauthCallback, value: params.callback});
292
+ }
293
+
294
+ if (params.verifier) {
295
+ signatureParams.push({system: true, key: OAUTH1_PARAMS.oauthVerifier, value: params.verifier});
296
+ }
297
+
288
298
  // filter empty signature parameters
289
299
  signatureParams = _.filter(signatureParams, function (param) {
290
300
  return params.addEmptyParamsToSign || param.value;
@@ -6,7 +6,7 @@ var _ = require('lodash'),
6
6
  MAC = 'mac',
7
7
  AUTHORIZATION = 'Authorization',
8
8
  ACCESS_TOKEN = 'access_token',
9
- AUTHORIZATION_PREFIX = 'Bearer ',
9
+ AUTHORIZATION_PREFIX = 'Bearer',
10
10
  OAUTH2_PARAMETERS = [
11
11
  'accessToken',
12
12
  'addTokenTo',
@@ -92,7 +92,10 @@ module.exports = {
92
92
  params.addTokenTo = params.addTokenTo || HEADER; // Add token to header by default
93
93
  params.tokenType = params.tokenType || BEARER; // Use `Bearer` token type by default
94
94
  params.headerPrefix = _.isNil(params.headerPrefix) ?
95
- AUTHORIZATION_PREFIX : String(params.headerPrefix);
95
+ AUTHORIZATION_PREFIX : _.trim(String(params.headerPrefix));
96
+
97
+ // add a space after prefix only if there is any prefix
98
+ params.headerPrefix && (params.headerPrefix += ' ');
96
99
 
97
100
  // Some servers send 'Bearer' while others send 'bearer'
98
101
  tokenType = _.toLower(params.tokenType);
@@ -495,7 +495,7 @@ module.exports = {
495
495
  // Refer: https://github.com/postmanlabs/postman-sandbox/pull/512
496
496
  // Adding back here to avoid breaking change in `script` callback.
497
497
  // @todo revisit script callback args in runtime v8.
498
- payload.context && payload.context.response &&
498
+ result && payload.context && payload.context.response &&
499
499
  (result.response = new sdk.Response(payload.context.response));
500
500
 
501
501
  // persist the pm.variables for the next script
package/npm/dist.js ADDED
@@ -0,0 +1,39 @@
1
+ const fs = require('fs'),
2
+ path = require('path'),
3
+ chalk = require('chalk'),
4
+ {rm, mkdir} = require('shelljs'),
5
+ browserify = require('browserify'),
6
+
7
+ INPUT = path.join(__dirname, '../index.js'),
8
+ OUT_DIR = path.join(__dirname, '../dist'),
9
+ OUTPUT = path.join(OUT_DIR, 'index.js');
10
+
11
+ console.info(chalk.yellow.bold('Generating bundle in "dist" directory...'));
12
+
13
+ rm('-rf', OUT_DIR);
14
+ mkdir('-p', OUT_DIR);
15
+
16
+ browserify(INPUT, {standalone: 'PostmanRuntime'}).bundle((err, bundle) => {
17
+ if (err) {
18
+ console.error(err);
19
+ process.exit(1);
20
+ }
21
+
22
+ // terser requires Node.js >= 8
23
+ try {
24
+ require('terser').minify(bundle.toString(), {mangle: true})
25
+ .then(({code}) => {
26
+ fs.writeFileSync(OUTPUT, code);
27
+ })
28
+ .catch((err) => {
29
+ console.error(err);
30
+ process.exit(1);
31
+ });
32
+ }
33
+ catch (error) {
34
+ console.info(chalk.red.bold('Compression failed!'));
35
+
36
+ // write uncompressed file and don't end with exit code 1
37
+ fs.writeFileSync(OUTPUT, bundle);
38
+ }
39
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postman-runtime",
3
- "version": "7.26.3-beta.1",
3
+ "version": "7.26.5",
4
4
  "description": "Underlying library of executing Postman Collections (used by Newman)",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -8,7 +8,7 @@
8
8
  "test": "test"
9
9
  },
10
10
  "scripts": {
11
- "test": "npm run test-lint && npm run test-system && npm run test-unit && npm run test-integration && npm run test-browser && npm run test-integration-legacy",
11
+ "test": "npm run test-lint && npm run test-system && npm run test-unit && npm run test-integration && npm run test-integration-legacy",
12
12
  "test-system": "node npm/test-system.js",
13
13
  "test-lint": "node npm/test-lint.js",
14
14
  "test-unit": "node npm/test-unit.js",
@@ -21,7 +21,9 @@
21
21
  "build-wiki": "node npm/build-wiki.js",
22
22
  "publish-docs": "node npm/publish-docs.js",
23
23
  "publish-wiki": "node npm/build-wiki.js",
24
- "memory-check": "npm/memory-check.sh"
24
+ "memory-check": "npm/memory-check.sh",
25
+ "dist": "node npm/dist.js",
26
+ "prepublish": "npm run dist"
25
27
  },
26
28
  "repository": {
27
29
  "type": "git",
@@ -31,19 +33,19 @@
31
33
  "license": "Apache-2.0",
32
34
  "dependencies": {
33
35
  "async": "2.6.3",
34
- "aws4": "1.10.0",
35
- "eventemitter3": "4.0.4",
36
+ "aws4": "1.10.1",
37
+ "eventemitter3": "4.0.7",
36
38
  "handlebars": "4.7.6",
37
39
  "http-reasons": "0.1.0",
38
40
  "httpntlm": "1.7.6",
39
41
  "inherits": "2.0.4",
40
42
  "js-sha512": "0.8.0",
41
- "lodash": "4.17.19",
43
+ "lodash": "4.17.20",
42
44
  "node-oauth1": "1.3.0",
43
45
  "performance-now": "2.1.0",
44
- "postman-collection": "3.6.4",
46
+ "postman-collection": "3.6.6",
45
47
  "postman-request": "2.88.1-postman.24",
46
- "postman-sandbox": "3.5.7",
48
+ "postman-sandbox": "3.5.9",
47
49
  "postman-url-encoder": "2.1.3",
48
50
  "resolve-from": "5.0.0",
49
51
  "serialised-error": "1.1.3",
@@ -51,8 +53,8 @@
51
53
  "uuid": "3.4.0"
52
54
  },
53
55
  "devDependencies": {
54
- "ajv": "6.12.3",
55
- "browserify": "16.5.1",
56
+ "ajv": "6.12.4",
57
+ "browserify": "16.5.2",
56
58
  "chai": "4.2.0",
57
59
  "colors": "1.4.0",
58
60
  "editorconfig": "0.15.3",
@@ -66,8 +68,8 @@
66
68
  "js-yaml": "3.14.0",
67
69
  "jsdoc": "3.6.5",
68
70
  "jsdoc-to-markdown": "6.0.1",
69
- "karma": "5.0.5",
70
- "karma-browserify": "7.0.0",
71
+ "karma": "3.1.4",
72
+ "karma-browserify": "6.1.0",
71
73
  "karma-chrome-launcher": "3.1.0",
72
74
  "karma-mocha": "2.0.1",
73
75
  "karma-mocha-reporter": "2.2.5",
@@ -77,12 +79,13 @@
77
79
  "passport": "0.4.1",
78
80
  "passport-http": "0.3.0",
79
81
  "postman-jsdoc-theme": "0.0.3",
80
- "puppeteer": "3.0.4",
82
+ "puppeteer": "1.18.1",
81
83
  "recursive-readdir": "2.2.2",
82
84
  "server-destroy": "1.0.1",
83
85
  "shelljs": "0.8.4",
84
86
  "sinon": "8.1.1",
85
87
  "teleport-javascript": "1.0.0",
88
+ "terser": "5.2.1",
86
89
  "tmp": "0.2.1",
87
90
  "yankee": "1.0.8"
88
91
  },
@@ -637,7 +637,7 @@ describe('digest auth', function () {
637
637
  });
638
638
  });
639
639
 
640
- describe('with binary body and qop=auth-int', function () {
640
+ (typeof window === 'undefined' ? describe : describe.skip)('with binary body and qop=auth-int', function () {
641
641
  before(function (done) {
642
642
  // perform the collection run
643
643
  this.run({
@@ -1,7 +1,7 @@
1
1
  var expect = require('chai').expect,
2
2
  _ = require('lodash');
3
3
 
4
- describe('NTLM', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('NTLM', function () {
5
5
  // @todo Add '/ntlm' endpoint in echo server
6
6
  var USERNAME = 'postman',
7
7
  PASSWORD = 'NTLM@123',
@@ -1,6 +1,7 @@
1
1
  var fs = require('fs'),
2
2
  path = require('path'),
3
- expect = require('chai').expect;
3
+ expect = require('chai').expect,
4
+ IS_BROWSER = typeof window !== 'undefined';
4
5
 
5
6
  describe('oauth 1', function () {
6
7
  var testrun;
@@ -80,7 +81,7 @@ describe('oauth 1', function () {
80
81
  });
81
82
  });
82
83
 
83
- describe('with urlencoded body having disabled params', function () {
84
+ (IS_BROWSER ? describe.skip : describe)('with urlencoded body having disabled params', function () {
84
85
  before(function (done) {
85
86
  // perform the collection run
86
87
  this.run({
@@ -440,7 +441,8 @@ describe('oauth 1', function () {
440
441
  });
441
442
  });
442
443
 
443
- describe('includeBodyHash: true', function () {
444
+ (IS_BROWSER ? describe.skip : describe)('includeBodyHash: true', function () {
445
+ // eslint-disable-next-line mocha/no-sibling-hooks
444
446
  before(function (done) {
445
447
  // perform the collection run
446
448
  this.run({
@@ -475,6 +477,7 @@ describe('oauth 1', function () {
475
477
  });
476
478
  });
477
479
 
480
+ // eslint-disable-next-line mocha/no-identical-title
478
481
  it('should have completed the run', function () {
479
482
  expect(testrun).to.be.ok;
480
483
  expect(testrun).to.nested.include({
@@ -2,7 +2,7 @@ var sinon = require('sinon'),
2
2
  expect = require('chai').expect;
3
3
 
4
4
  // @todo move to bipbip
5
- describe('Benchmark: large response', function () {
5
+ (typeof window === 'undefined' ? describe : describe.skip)('Benchmark: large response', function () {
6
6
  var testrun;
7
7
 
8
8
  // @todo increase to 100 MB once we drop support for Node v6
@@ -35,7 +35,6 @@ runtime = function (spec, done) {
35
35
  before(function () {
36
36
  global.expect = expect; // expose global
37
37
  global.servers = require('../fixtures/servers/servers.json');
38
- global.isBrowser = typeof window !== 'undefined';
39
38
  this.run = runtime;
40
39
  });
41
40
 
@@ -1,11 +1,12 @@
1
1
  var fs = require('fs'),
2
2
  expect = require('chai').expect,
3
- sinon = require('sinon');
3
+ sinon = require('sinon'),
4
+ IS_BROWSER = typeof window !== 'undefined';
4
5
 
5
6
  describe('file upload in request body', function () {
6
7
  var testrun;
7
8
 
8
- describe('with mode formdata & file', function () {
9
+ (IS_BROWSER ? describe.skip : describe)('with mode formdata & file', function () {
9
10
  before(function (done) {
10
11
  this.run({
11
12
  fileResolver: fs,
@@ -186,7 +187,7 @@ describe('file upload in request body', function () {
186
187
  .to.equal('Form param `userData`, file load error: missing file source');
187
188
  });
188
189
 
189
- it('should warn for missing src in binary mode', function () {
190
+ (IS_BROWSER ? it.skip : it)('should warn for missing src in binary mode', function () {
190
191
  sinon.assert.calledWith(testrun.request.getCall(2), null);
191
192
 
192
193
  expect(testrun.console.getCall(2).args[1]).to.equal('warn');
@@ -248,7 +249,7 @@ describe('file upload in request body', function () {
248
249
  });
249
250
  });
250
251
 
251
- describe('false', function () {
252
+ (IS_BROWSER ? describe.skip : describe)('false', function () {
252
253
  before(function (done) {
253
254
  this.run({
254
255
  fileResolver: fs,
@@ -344,7 +345,8 @@ describe('file upload in request body', function () {
344
345
  });
345
346
  });
346
347
 
347
- describe('with missing file', function () {
348
+ (IS_BROWSER ? describe.skip : describe)('with missing file', function () {
349
+ // eslint-disable-next-line mocha/no-sibling-hooks
348
350
  before(function (done) {
349
351
  this.run({
350
352
  fileResolver: fs,
@@ -392,6 +394,7 @@ describe('file upload in request body', function () {
392
394
  });
393
395
  });
394
396
 
397
+ // eslint-disable-next-line mocha/no-identical-title
395
398
  it('should complete the run', function () {
396
399
  expect(testrun).to.be.ok;
397
400
  sinon.assert.calledOnce(testrun.start);
@@ -429,7 +432,8 @@ describe('file upload in request body', function () {
429
432
  });
430
433
  });
431
434
 
432
- describe('with src being a directory', function () {
435
+ (IS_BROWSER ? describe.skip : describe)('with src being a directory', function () {
436
+ // eslint-disable-next-line mocha/no-sibling-hooks
433
437
  before(function (done) {
434
438
  this.run({
435
439
  fileResolver: fs,
@@ -451,6 +455,7 @@ describe('file upload in request body', function () {
451
455
  });
452
456
  });
453
457
 
458
+ // eslint-disable-next-line mocha/no-identical-title
454
459
  it('should complete the run', function () {
455
460
  expect(testrun).to.be.ok;
456
461
  sinon.assert.calledOnce(testrun.start);
@@ -467,7 +472,8 @@ describe('file upload in request body', function () {
467
472
  });
468
473
  });
469
474
 
470
- describe('with file permission denied', function () {
475
+ (IS_BROWSER ? describe.skip : describe)('with file permission denied', function () {
476
+ // eslint-disable-next-line mocha/no-sibling-hooks
471
477
  before(function (done) {
472
478
  this.run({
473
479
  fileResolver: {
@@ -494,6 +500,7 @@ describe('file upload in request body', function () {
494
500
  });
495
501
  });
496
502
 
503
+ // eslint-disable-next-line mocha/no-identical-title
497
504
  it('should complete the run', function () {
498
505
  expect(testrun).to.be.ok;
499
506
  sinon.assert.calledOnce(testrun.start);
@@ -510,7 +517,8 @@ describe('file upload in request body', function () {
510
517
  });
511
518
  });
512
519
 
513
- describe('with supported fileResolver', function () {
520
+ (IS_BROWSER ? describe.skip : describe)('with supported fileResolver', function () {
521
+ // eslint-disable-next-line mocha/no-sibling-hooks
514
522
  before(function (done) {
515
523
  this.run({
516
524
  fileResolver: {
@@ -541,6 +549,7 @@ describe('file upload in request body', function () {
541
549
  });
542
550
  });
543
551
 
552
+ // eslint-disable-next-line mocha/no-identical-title
544
553
  it('should complete the run', function () {
545
554
  expect(testrun).to.be.ok;
546
555
  sinon.assert.calledOnce(testrun.start);
@@ -1,11 +1,12 @@
1
1
  var sinon = require('sinon'),
2
- expect = require('chai').expect;
2
+ expect = require('chai').expect,
3
+ IS_BROWSER = typeof window !== 'undefined';
3
4
 
4
5
  describe('protocolProfileBehavior', function () {
5
6
  var testrun;
6
7
 
7
8
  describe('with disableBodyPruning: true', function () {
8
- describe('HTTP GET', function () {
9
+ (IS_BROWSER ? describe.skip : describe)('HTTP GET', function () {
9
10
  before(function (done) {
10
11
  this.run({
11
12
  collection: {
@@ -52,7 +53,8 @@ describe('protocolProfileBehavior', function () {
52
53
  });
53
54
  });
54
55
 
55
- describe('HTTP HEAD', function () {
56
+ (IS_BROWSER ? describe.skip : describe)('HTTP HEAD', function () {
57
+ // eslint-disable-next-line mocha/no-sibling-hooks
56
58
  before(function (done) {
57
59
  this.run({
58
60
  collection: {
@@ -76,6 +78,7 @@ describe('protocolProfileBehavior', function () {
76
78
  });
77
79
  });
78
80
 
81
+ // eslint-disable-next-line mocha/no-identical-title
79
82
  it('should complete the run', function () {
80
83
  expect(testrun).to.be.ok;
81
84
  sinon.assert.calledOnce(testrun.start);
@@ -148,7 +151,8 @@ describe('protocolProfileBehavior', function () {
148
151
  });
149
152
  });
150
153
 
151
- describe('HTTP GET + Inherit Protocol Profile Behavior', function () {
154
+ (IS_BROWSER ? describe.skip : describe)('HTTP GET + Inherit Protocol Profile Behavior', function () {
155
+ // eslint-disable-next-line mocha/no-sibling-hooks
152
156
  before(function (done) {
153
157
  this.run({
154
158
  collection: {
@@ -177,6 +181,7 @@ describe('protocolProfileBehavior', function () {
177
181
  });
178
182
  });
179
183
 
184
+ // eslint-disable-next-line mocha/no-identical-title
180
185
  it('should complete the run', function () {
181
186
  expect(testrun).to.be.ok;
182
187
  sinon.assert.calledOnce(testrun.start);
@@ -184,6 +189,7 @@ describe('protocolProfileBehavior', function () {
184
189
  sinon.assert.calledWith(testrun.done.getCall(0), null);
185
190
  });
186
191
 
192
+ // eslint-disable-next-line mocha/no-identical-title
187
193
  it('should send body with GET method', function () {
188
194
  sinon.assert.calledOnce(testrun.request);
189
195
  sinon.assert.calledWith(testrun.request.getCall(0), null);
@@ -344,7 +350,7 @@ describe('protocolProfileBehavior', function () {
344
350
  });
345
351
  });
346
352
 
347
- describe('with disableBodyPruning: undefined', function () {
353
+ (IS_BROWSER ? describe.skip : describe)('with disableBodyPruning: undefined', function () {
348
354
  describe('HTTP GET', function () {
349
355
  before(function (done) {
350
356
  this.run({
@@ -1,7 +1,7 @@
1
1
  var sinon = require('sinon'),
2
2
  expect = require('chai').expect;
3
3
 
4
- describe('protocolProfileBehavior', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('protocolProfileBehavior', function () {
5
5
  var testrun;
6
6
 
7
7
  describe('with disabledSystemHeaders: undefined', function () {
@@ -4,7 +4,7 @@ var fs = require('fs'),
4
4
  expect = require('chai').expect,
5
5
  CertificateList = require('postman-collection').CertificateList;
6
6
 
7
- describe('protocolProfileBehavior', function () {
7
+ (typeof window === 'undefined' ? describe : describe.skip)('protocolProfileBehavior', function () {
8
8
  var testrun;
9
9
 
10
10
  describe('with followRedirects: false', function () {
@@ -1,4 +1,5 @@
1
- var expect = require('chai').expect;
1
+ var expect = require('chai').expect,
2
+ IS_BROWSER = typeof window !== 'undefined';
2
3
 
3
4
  describe('Request Body Mode: formdata', function () {
4
5
  var testrun,
@@ -219,7 +220,7 @@ describe('Request Body Mode: formdata', function () {
219
220
  });
220
221
  });
221
222
 
222
- describe('with undefined value of type file', function () {
223
+ (IS_BROWSER ? describe.skip : describe)('with undefined value of type file', function () {
223
224
  before(function (done) {
224
225
  this.run({
225
226
  collection: {
@@ -307,7 +308,8 @@ describe('Request Body Mode: formdata', function () {
307
308
  });
308
309
  });
309
310
 
310
- describe('with invalid content-type', function () {
311
+ (IS_BROWSER ? describe.skip : describe)('with invalid content-type', function () {
312
+ // eslint-disable-next-line mocha/no-sibling-hooks
311
313
  before(function (done) {
312
314
  this.run({
313
315
  collection: {
@@ -334,6 +336,7 @@ describe('Request Body Mode: formdata', function () {
334
336
  });
335
337
  });
336
338
 
339
+ // eslint-disable-next-line mocha/no-identical-title
337
340
  it('should have completed the run', function () {
338
341
  expect(testrun).to.be.ok;
339
342
  expect(testrun.done.getCall(0).args[0]).to.be.null;
@@ -358,7 +361,8 @@ describe('Request Body Mode: formdata', function () {
358
361
  });
359
362
  });
360
363
 
361
- describe('with invalid content-type and disabled header', function () {
364
+ (IS_BROWSER ? describe.skip : describe)('with invalid content-type and disabled header', function () {
365
+ // eslint-disable-next-line mocha/no-sibling-hooks
362
366
  before(function (done) {
363
367
  this.run({
364
368
  collection: {
@@ -390,6 +394,7 @@ describe('Request Body Mode: formdata', function () {
390
394
  });
391
395
  });
392
396
 
397
+ // eslint-disable-next-line mocha/no-identical-title
393
398
  it('should have completed the run', function () {
394
399
  expect(testrun).to.be.ok;
395
400
  expect(testrun.done.getCall(0).args[0]).to.be.null;
@@ -3,7 +3,7 @@ var sinon = require('sinon'),
3
3
  Header = require('postman-collection').Header,
4
4
  cookieJar = require('postman-request').jar();
5
5
 
6
- describe('request headers', function () {
6
+ (typeof window === 'undefined' ? describe : describe.skip)('request headers', function () {
7
7
  var testrun,
8
8
  HEADERS_URL,
9
9
  COOKIES_URL;
@@ -267,7 +267,8 @@ describe('intermediate requests from auth', function () {
267
267
  expect(request.url.toString()).to.eql('https://postman-echo.com/basic-auth');
268
268
  });
269
269
 
270
- it('should have sent the intermediate request, and passed error', function () {
270
+ (typeof window === 'undefined' ?
271
+ it : it.skip)('should have sent the intermediate request, and passed error', function () {
271
272
  var err = testrun.request.firstCall.args[0],
272
273
  ioErr = testrun.io.firstCall.args[0],
273
274
  request = testrun.request.firstCall.args[3];
@@ -1,7 +1,7 @@
1
1
  var expect = require('chai').expect,
2
2
  sinon = require('sinon');
3
3
 
4
- describe('invalid url', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('invalid url', function () {
5
5
  describe('with useWhatWGUrlParser: true', function () {
6
6
  var testrun;
7
7
 
@@ -2,7 +2,7 @@ var expect = require('chai').expect;
2
2
 
3
3
  // IPv6 is disabled on Travis
4
4
  // eslint-disable-next-line no-process-env
5
- (process.env.TRAVIS ? describe.skip : describe)('IPv6 server', function () {
5
+ (process.env.TRAVIS || typeof window !== 'undefined' ? describe.skip : describe)('IPv6 server', function () {
6
6
  var testrun;
7
7
 
8
8
  before(function (done) {
@@ -1,7 +1,7 @@
1
1
  var _ = require('lodash'),
2
2
  expect = require('chai').expect;
3
3
 
4
- describe('cookie sandbox request interaction', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('cookie sandbox request interaction', function () {
5
5
  var cookieUrl = 'https://postman-echo.com/cookies';
6
6
 
7
7
  describe('intra-sandbox', function () {
@@ -410,7 +410,7 @@ describe('requests from sandbox', function () {
410
410
  });
411
411
  });
412
412
 
413
- it('should error out on the first request', function () {
413
+ (typeof window === 'undefined' ? it : it.skip)('should error out on the first request', function () {
414
414
  var error = testrun.io.firstCall.args[0],
415
415
  request = testrun.io.firstCall.args[4],
416
416
  response = testrun.io.firstCall.args[3],
@@ -428,7 +428,8 @@ describe('requests from sandbox', function () {
428
428
  });
429
429
  });
430
430
 
431
- it('should have provided the error to the sandbox sendrequest function', function () {
431
+ (typeof window === 'undefined' ?
432
+ it : it.skip)('should have provided the error to the sandbox sendrequest function', function () {
432
433
  var assertion = testrun.assertion.firstCall.args[1][0];
433
434
 
434
435
  expect(assertion).to.deep.include({
@@ -1,7 +1,7 @@
1
1
  var sinon = require('sinon'),
2
2
  expect = require('chai').expect;
3
3
 
4
- describe('Cookies expiry in response callback', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('Cookies expiry in response callback', function () {
5
5
  var testrun;
6
6
 
7
7
  before(function (done) {
@@ -1,7 +1,7 @@
1
1
  var dns = require('dns'),
2
2
  expect = require('chai').expect;
3
3
 
4
- describe('UTF-8 hostname', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('UTF-8 hostname', function () {
5
5
  var testrun;
6
6
 
7
7
  before(function (done) {
@@ -1,7 +1,7 @@
1
1
  var expect = require('chai').expect,
2
2
  encoder = require('postman-url-encoder/encoder');
3
3
 
4
- describe('URL encoding', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('URL encoding', function () {
5
5
  var URL;
6
6
 
7
7
  before(function () {
@@ -3,7 +3,7 @@ var sinon = require('sinon'),
3
3
  https = require('https'),
4
4
  expect = require('chai').expect;
5
5
 
6
- describe('Requester Spec: agents', function () {
6
+ (typeof window === 'undefined' ? describe : describe.skip)('Requester Spec: agents', function () {
7
7
  var testrun;
8
8
 
9
9
  describe('http agent', function () {
@@ -2,7 +2,7 @@ var fs = require('fs'),
2
2
  path = require('path'),
3
3
  expect = require('chai').expect;
4
4
 
5
- describe('Requester Spec: extendedRootCA', function () {
5
+ (typeof window === 'undefined' ? describe : describe.skip)('Requester Spec: extendedRootCA', function () {
6
6
  var testrun,
7
7
  CACertPath = path.resolve(__dirname, '../../fixtures/certificates/ca.pem');
8
8
 
@@ -1,7 +1,7 @@
1
1
  var expect = require('chai').expect,
2
2
  sinon = require('sinon');
3
3
 
4
- describe('Requester Spec: history', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('Requester Spec: history', function () {
5
5
  var testrun;
6
6
 
7
7
  describe('default', function () {
@@ -1,7 +1,7 @@
1
1
  var sinon = require('sinon'),
2
2
  expect = require('chai').expect;
3
3
 
4
- describe('Requester Spec: maxResponseSize', function () {
4
+ (typeof window === 'undefined' ? describe : describe.skip)('Requester Spec: maxResponseSize', function () {
5
5
  var testrun,
6
6
  HOST = 'https://httpbin.org/bytes/10';
7
7