mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-08-30 16:02:09 +08:00
add ability to call self-signed or invalid certificate clients
This commit is contained in:
+8
-1
@@ -2,8 +2,15 @@ var inspect = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('circular', function (t) {
|
||||
t.plan(1);
|
||||
t.plan(2);
|
||||
var obj = { a: 1, b: [3, 4] };
|
||||
obj.c = obj;
|
||||
t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }');
|
||||
|
||||
var double = {};
|
||||
double.a = [double];
|
||||
double.b = {};
|
||||
double.b.inner = double.b;
|
||||
double.b.obj = double;
|
||||
t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }');
|
||||
});
|
||||
|
||||
+2
-1
@@ -2,8 +2,9 @@ var inspect = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('deep', function (t) {
|
||||
t.plan(2);
|
||||
t.plan(3);
|
||||
var obj = [[[[[[500]]]]]];
|
||||
t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]');
|
||||
t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]');
|
||||
t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]');
|
||||
});
|
||||
|
||||
+2
-2
@@ -12,9 +12,9 @@ test('function name', function (t) {
|
||||
var f = (function () {
|
||||
return function () {};
|
||||
}());
|
||||
f.toString = function () { return 'function xxx () {}'; };
|
||||
f.toString = function toStr() { return 'function xxx () {}'; };
|
||||
var obj = [1, 2, f, 4];
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]');
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]');
|
||||
});
|
||||
|
||||
test('anon function', function (t) {
|
||||
|
||||
+19
-1
@@ -21,7 +21,25 @@ test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspec
|
||||
|
||||
t.equal(inspect([obj, []]), '[ ' + (utilInspect.custom ? 'symbol' : 'string') + ', [] ]');
|
||||
t.equal(inspect([obj, []], { customInspect: true }), '[ ' + (utilInspect.custom ? 'symbol' : 'string') + ', [] ]');
|
||||
t.equal(inspect([obj, []], { customInspect: false }), '[ { inspect: [Function: stringInspect] }, [] ]');
|
||||
t.equal(
|
||||
inspect([obj, []], { customInspect: false }),
|
||||
'[ { inspect: [Function: stringInspect]' + (utilInspect.custom ? ', [' + inspect(utilInspect.custom) + ']: [Function: custom]' : '') + ' }, [] ]'
|
||||
);
|
||||
});
|
||||
|
||||
test('symbols', { skip: !hasSymbols }, function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = { a: 1 };
|
||||
obj[Symbol('test')] = 2;
|
||||
obj[Symbol.iterator] = 3;
|
||||
Object.defineProperty(obj, Symbol('non-enum'), {
|
||||
enumerable: false,
|
||||
value: 4
|
||||
});
|
||||
|
||||
t.equal(inspect(obj), '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }', 'object with symbols');
|
||||
t.equal(inspect([obj, []]), '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]', 'object with symbols');
|
||||
});
|
||||
|
||||
test('maxStringLength', function (t) {
|
||||
|
||||
+1
-1
@@ -7,6 +7,6 @@ test('interpolate low bytes', function (t) {
|
||||
t.plan(1);
|
||||
t.equal(
|
||||
inspect(obj),
|
||||
"{ x: 'a\\r\\nb', y: '\\x05! \\x1f \\x12' }"
|
||||
"{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }"
|
||||
);
|
||||
});
|
||||
|
||||
+4
@@ -167,5 +167,9 @@ test('RegExps', function (t) {
|
||||
t.equal(inspect(/a/g), '/a/g', 'regex shows properly');
|
||||
t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly');
|
||||
|
||||
var match = 'abc abc'.match(/[ab]+/);
|
||||
delete match.groups; // for node < 10
|
||||
t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user