Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/node_mod.../npm/node_mod.../prr
File: test.js
const test = require('tap').test
[0] Fix | Delete
, prr = require('./')
[1] Fix | Delete
[2] Fix | Delete
test('test prr(o, key, value) form', function (t) {
[3] Fix | Delete
t.plan(2)
[4] Fix | Delete
[5] Fix | Delete
var o = {}
[6] Fix | Delete
prr(o, 'foo', 'bar')
[7] Fix | Delete
t.equal(o.foo, 'bar', 'correct value')
[8] Fix | Delete
t.deepEqual(
[9] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo')
[10] Fix | Delete
, {
[11] Fix | Delete
enumerable : false
[12] Fix | Delete
, configurable : false
[13] Fix | Delete
, writable : false
[14] Fix | Delete
, value : 'bar'
[15] Fix | Delete
}
[16] Fix | Delete
, 'correct property descriptor'
[17] Fix | Delete
)
[18] Fix | Delete
t.end()
[19] Fix | Delete
})
[20] Fix | Delete
[21] Fix | Delete
test('test prr(o, { key: value }) form', function (t) {
[22] Fix | Delete
t.plan(2)
[23] Fix | Delete
[24] Fix | Delete
var o = {}
[25] Fix | Delete
prr(o, { foo: 'bar' })
[26] Fix | Delete
[27] Fix | Delete
t.equal(o.foo, 'bar', 'correct value')
[28] Fix | Delete
t.deepEqual(
[29] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo')
[30] Fix | Delete
, {
[31] Fix | Delete
enumerable : false
[32] Fix | Delete
, configurable : false
[33] Fix | Delete
, writable : false
[34] Fix | Delete
, value : 'bar'
[35] Fix | Delete
}
[36] Fix | Delete
, 'correct property descriptor'
[37] Fix | Delete
)
[38] Fix | Delete
t.end()
[39] Fix | Delete
})
[40] Fix | Delete
[41] Fix | Delete
test('test multiple key:value pairs', function (t) {
[42] Fix | Delete
var o = { foo: 'bar' }
[43] Fix | Delete
[44] Fix | Delete
prr(o, { one: 'ONE', two: 'TWO', obj: { o: 'o' }})
[45] Fix | Delete
[46] Fix | Delete
t.deepEqual(o, { foo: 'bar' }, 'properties are not enumerable')
[47] Fix | Delete
t.equal(o.one, 'ONE', 'correctly set property')
[48] Fix | Delete
t.equal(o.two, 'TWO', 'correctly set property')
[49] Fix | Delete
t.deepEqual(o.obj, { o: 'o' }, 'correctly set property')
[50] Fix | Delete
[51] Fix | Delete
;[ 'one', 'two', 'obj' ].forEach(function (p) {
[52] Fix | Delete
t.deepEqual(
[53] Fix | Delete
Object.getOwnPropertyDescriptor(o, p)
[54] Fix | Delete
, {
[55] Fix | Delete
enumerable : false
[56] Fix | Delete
, configurable : false
[57] Fix | Delete
, writable : false
[58] Fix | Delete
, value : p == 'obj' ? { o: 'o' } : p.toUpperCase()
[59] Fix | Delete
}
[60] Fix | Delete
, 'correct property descriptor'
[61] Fix | Delete
)
[62] Fix | Delete
})
[63] Fix | Delete
[64] Fix | Delete
t.end()
[65] Fix | Delete
})
[66] Fix | Delete
[67] Fix | Delete
test('test descriptor options', function (t) {
[68] Fix | Delete
var o = {}
[69] Fix | Delete
[70] Fix | Delete
prr(o, 'foo', 'bar', {
[71] Fix | Delete
enumerable : true
[72] Fix | Delete
, configurable : false
[73] Fix | Delete
})
[74] Fix | Delete
t.equal(o.foo, 'bar', 'correct value')
[75] Fix | Delete
t.deepEqual(
[76] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo')
[77] Fix | Delete
, {
[78] Fix | Delete
enumerable : true
[79] Fix | Delete
, configurable : false
[80] Fix | Delete
, writable : false
[81] Fix | Delete
, value : 'bar'
[82] Fix | Delete
}
[83] Fix | Delete
, 'correct property descriptor'
[84] Fix | Delete
)
[85] Fix | Delete
[86] Fix | Delete
prr(o, 'foo2', 'bar2', {
[87] Fix | Delete
enumerable : true
[88] Fix | Delete
, configurable : true
[89] Fix | Delete
, writable : false
[90] Fix | Delete
})
[91] Fix | Delete
t.equal(o.foo2, 'bar2', 'correct value')
[92] Fix | Delete
t.deepEqual(
[93] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo2')
[94] Fix | Delete
, {
[95] Fix | Delete
enumerable : true
[96] Fix | Delete
, configurable : true
[97] Fix | Delete
, writable : false
[98] Fix | Delete
, value : 'bar2'
[99] Fix | Delete
}
[100] Fix | Delete
, 'correct property descriptor'
[101] Fix | Delete
)
[102] Fix | Delete
[103] Fix | Delete
prr(o, 'foo3', 'bar3', {
[104] Fix | Delete
enumerable : true
[105] Fix | Delete
, configurable : true
[106] Fix | Delete
, writable : true
[107] Fix | Delete
})
[108] Fix | Delete
t.equal(o.foo3, 'bar3', 'correct value')
[109] Fix | Delete
t.deepEqual(
[110] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo3')
[111] Fix | Delete
, {
[112] Fix | Delete
enumerable : true
[113] Fix | Delete
, configurable : true
[114] Fix | Delete
, writable : true
[115] Fix | Delete
, value : 'bar3'
[116] Fix | Delete
}
[117] Fix | Delete
, 'correct property descriptor'
[118] Fix | Delete
)
[119] Fix | Delete
[120] Fix | Delete
t.end()
[121] Fix | Delete
})
[122] Fix | Delete
[123] Fix | Delete
[124] Fix | Delete
test('test descriptor options, string form', function (t) {
[125] Fix | Delete
var o = {}
[126] Fix | Delete
[127] Fix | Delete
prr(o, 'foo', 'bar', 'e')
[128] Fix | Delete
t.equal(o.foo, 'bar', 'correct value')
[129] Fix | Delete
t.deepEqual(
[130] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo')
[131] Fix | Delete
, {
[132] Fix | Delete
enumerable : true
[133] Fix | Delete
, configurable : false
[134] Fix | Delete
, writable : false
[135] Fix | Delete
, value : 'bar'
[136] Fix | Delete
}
[137] Fix | Delete
, 'correct property descriptor'
[138] Fix | Delete
)
[139] Fix | Delete
[140] Fix | Delete
prr(o, 'foo2', 'bar2', 'ec')
[141] Fix | Delete
t.equal(o.foo2, 'bar2', 'correct value')
[142] Fix | Delete
t.deepEqual(
[143] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo2')
[144] Fix | Delete
, {
[145] Fix | Delete
enumerable : true
[146] Fix | Delete
, configurable : true
[147] Fix | Delete
, writable : false
[148] Fix | Delete
, value : 'bar2'
[149] Fix | Delete
}
[150] Fix | Delete
, 'correct property descriptor'
[151] Fix | Delete
)
[152] Fix | Delete
[153] Fix | Delete
prr(o, 'foo3', 'bar3', 'ecw')
[154] Fix | Delete
t.equal(o.foo3, 'bar3', 'correct value')
[155] Fix | Delete
t.deepEqual(
[156] Fix | Delete
Object.getOwnPropertyDescriptor(o, 'foo3')
[157] Fix | Delete
, {
[158] Fix | Delete
enumerable : true
[159] Fix | Delete
, configurable : true
[160] Fix | Delete
, writable : true
[161] Fix | Delete
, value : 'bar3'
[162] Fix | Delete
}
[163] Fix | Delete
, 'correct property descriptor'
[164] Fix | Delete
)
[165] Fix | Delete
[166] Fix | Delete
t.end()
[167] Fix | Delete
})
[168] Fix | Delete
[169] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function