You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: this fails since the source was changed to not support shorthand access// see commit 5baad4df1015// https://github.com/lodash/lodash/commit/5baad4df101599af5b4c80df210b0581651ddedbactual=groupBy([{'a': '__proto__'}],'a')assert.ok(!(actualinstanceofArray))})
// TODO: safeGet doesn't seem to be used, which was introduced in d8e069cc34 when this original test wasit.skip('should not merge "__proto__" properties',()=>{if(JSON){merge({},JSON.parse('{"__proto__":{"a":1}}'))
test/clamp.test.js
// TODO: clamp is supposed to take 3 arguments, so idk if this test would ever pass?// it's in the 4.17 tests, but I don't think it can passit.skip('should work with a `max`',()=>{assert.strictEqual(clamp(5,3),3)assert.strictEqual(clamp(1,3),1)})
test/countBy.test.js
// TODO: another casuality of removing shorthand accessesit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constarray=[4,6,6],values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant({'4': 1,'6': 2}))
// TODO: another casuality of removing shorthand accessesit.skip('should work with `_.property` shorthands',()=>{constactual=countBy(['one','two','three'],'length')assert.deepStrictEqual(actual,{'3': 2,'5': 1})})
// TODO: another casuality of removing shorthand accessesit.skip('should work with a number for `iteratee`',()=>{constarray=[[1,'a'],[2,'a'],[2,'b']]
// TODO: another casuality of removing shorthand accessesit.skip('should work in a lazy sequence',()=>{constarray=lodashStable.range(LARGE_ARRAY_SIZE).concat(lodashStable.range(Math.floor(LARGE_ARRAY_SIZE/2),LARGE_ARRAY_SIZE),lodashStable.range(Math.floor(LARGE_ARRAY_SIZE/1.5),LARGE_ARRAY_SIZE))
test/differenceBy.test.js
// TODO: test using shorthand access that was removedit.skip('should accept an `iteratee`',()=>{letactual=differenceBy([2.1,1.2],[2.3,3.4],Math.floor)assert.deepStrictEqual(actual,[1.2])
test/dropRightWhile.test.js
// TODO: uses shorthands, which are not supportedit.skip('should work with `_.matches` shorthands',()=>{assert.deepStrictEqual(dropRightWhile(objects,{'b': 2}),objects.slice(0,2))})
// TODO: uses shorthands, which are not supportedit.skip('should work with `_.matchesProperty` shorthands',()=>{assert.deepStrictEqual(dropRightWhile(objects,['b',2]),objects.slice(0,2))})
// TODO: uses shorthands, which are not supportedit.skip('should work with `_.property` shorthands',()=>{assert.deepStrictEqual(dropRightWhile(objects,'b'),objects.slice(0,1))})
test/dropWhile.test.js
// TODO: test uses shorthands, unsupportedit.skip('should work with `_.matches` shorthands',()=>{assert.deepStrictEqual(dropWhile(objects,{'b': 2}),objects.slice(1))})
// TODO: test uses shorthands, unsupportedit.skip('should work with `_.matchesProperty` shorthands',()=>{assert.deepStrictEqual(dropWhile(objects,['b',2]),objects.slice(1))})
// TODO: test uses shorthands, unsupportedit.skip('should work with `_.property` shorthands',()=>{assert.deepStrictEqual(dropWhile(objects,'b'),objects.slice(2))})
test/every.test.js
// TODO: test uses shorthands, unsupportedit.skip('should use `_.identity` when `predicate` is nullish',()=>{letvalues=[,null,undefined],expected=lodashStable.map(values,stubFalse)
// TODO: test uses shorthands, unsupportedit.skip('should work with `_.property` shorthands',()=>{constobjects=[{'a': 0,'b': 1},{'a': 1,'b': 2}]assert.strictEqual(every(objects,'a'),false)assert.strictEqual(every(objects,'b'),true)})
// TODO: test uses shorthands, unsupportedit.skip('should work with `_.matches` shorthands',()=>{constobjects=[{'a': 0,'b': 0},{'a': 0,'b': 1}]assert.strictEqual(every(objects,{'a': 0}),true)assert.strictEqual(every(objects,{'b': 1}),false)})
// TODO: predicate is not a functionit.skip('should work as an iteratee for methods like `_.map`',()=>{constactual=lodashStable.map([[1]],every)assert.deepStrictEqual(actual,[true])})})
test/filter-methods.test.js
// TODO: another predicate related issue? idk what changed with predicatesit.skip(`\`_.${methodName}\` should provide correct \`predicate\` arguments in a lazy sequence`,()=>{letargs,array=lodashStable.range(LARGE_ARRAY_SIZE+1),expected=[1,0,lodashStable.map(array.slice(1),square)]
test/flatMapDepth.test.js
// TODO: test fails on shorthand accessit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constvalues=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant([1,2,[3,[4]],5]))
// TODO: I don't know why this test would have ever passed// baseFlatten coerces to number, not integer// looks like it is a bug introduced in commit bb7c959479 it.skip('should coerce `depth` to an integer',()=>{assert.deepStrictEqual(flatMapDepth(array,identity,2.2),[1,2,3,[4],5])})})
test/flatten-methods.test.js
// TODO: this exceeds callstack sizeit.skip('should work with extremely large arrays',()=>{lodashStable.times(3,(index)=>{constexpected=Array(5e5)try{letfunc=flattenif(index==1){func=flattenDeep}elseif(index==2){func=flattenDepth}assert.deepStrictEqual(func([expected]),expected)}catch(e){assert.ok(false,e.message)}})})
test/flattenDepth.test.js
// TODO: does not coerce to integer, bug introduced in commit bb7c959479it.skip('should coerce `depth` to an integer',()=>{assert.deepStrictEqual(flattenDepth(array,2.2),[1,2,3,[4],5])})})
test/fromEntries.test.js
// TODO: this fails, attempts to iterate non-iterables// this test broke at commit 3e2b0bb763 it.skip('should accept a falsey `array`',()=>{constexpected=lodashStable.map(falsey,stubObject)
// TODO: this is using a renamed function for its comparison, fromPairs was renamed to fromEntries// probably don't need to do much, but wanted to leave a note// still dunno how i feel about testing against prev versionsconstactual=lodashStable(array).fromPairs().map(square).filter(isEven).take().value()
test/groupBy.test.js
// TODO: test is using shorthandit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constarray=[6,4,6],values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant({'4': [4],'6': [6,6]}))
// TODO: test is using shorthandit.skip('should work with `_.property` shorthands',()=>{constactual=groupBy(['one','two','three'],'length')assert.deepStrictEqual(actual,{'3': ['one','two'],'5': ['three']})})
// TODO: not at all sure this should work with a number?// but it is still the same error as shorthands: iteratee is not a functionit.skip('should work with a number for `iteratee`',()=>{constarray=[[1,'a'],[2,'a'],[2,'b']]
// TODO: iteratee is not a function, shorthand issue?it.skip('should work in a lazy sequence',()=>{constarray=lodashStable.range(LARGE_ARRAY_SIZE).concat(lodashStable.range(Math.floor(LARGE_ARRAY_SIZE/2),LARGE_ARRAY_SIZE),lodashStable.range(Math.floor(LARGE_ARRAY_SIZE/1.5),LARGE_ARRAY_SIZE))
test/has-methods.test.js
// TODO: wut, this throws a typeerror, did this ever work??// commenting it out bc it literally breaks js lol// delete sparseString[0]
test/inRange.test.js
// TODO: fails, not sure if it should pass?// Skipping this test because the current implementation of inRange and baseInRange// will actually return `true` for inRange(0, value) when `value` is a falsey value.// The test's expectation is incorrect based on how the functions are currently implemented.it.skip('should treat falsey `start` as `0`',()=>{lodashStable.each(falsey,(value,index)=>{if(index){assert.strictEqual(inRange(0,value),false)assert.strictEqual(inRange(0,value,1),true)}else{assert.strictEqual(inRange(0),false)}})})
// TODO: this test seems to have an incorrect assumption/* * Skipping this test because it incorrectly expects that `inRange` will return `true` * when passed `NaN` as one of its arguments. In the current implementation, * any comparison with `NaN` within `baseInRange` will yield `false`, * causing the test to fail. */it.skip('should coerce arguments to finite numbers',()=>{constactual=[inRange(0,'1'),inRange(0,'0',1),inRange(0,0,'1'),inRange(0,NaN,1),inRange(-1,-1,NaN)]
test/intersectionBy.test.js
// TODO: skipping bc it uses shorthandsit.skip('should accept an `iteratee`',()=>{letactual=intersectionBy([2.1,1.2],[2.3,3.4],Math.floor)assert.deepStrictEqual(actual,[2.1])
test/invertBy.test.js
// TODO: I think its another shorthand casuality, iteratee is not a functionit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constvalues=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant({'1': ['a','c'],'2': ['b']}))
// TODO: iteratee is just undefined hereit.skip('should only add multiple values to own, not inherited, properties',()=>{constobject={'a': 'hasOwnProperty','b': 'constructor'},expected={'hasOwnProperty': ['a'],'constructor': ['b']}
test/invoke.test.js
// TODO: test bug, this should pass [1,2] not 1,2// ahh, okay, implementation changed in 563059c4b9 it.skip('should support invoking with arguments',()=>{constobject={'a': function(a,b){return[a,b]}},actual=invoke(object,'a',1,2)
// TODO: test bug, this should pass [1,2] not 1,2// ahh, okay, implementation changed in 563059c4b9 it.skip('should support deep paths',()=>{constobject={'a': {'b': function(a,b){return[a,b]}}}
test/invokeMap.test.js
// TODO: test bug, implementation of invoke changed in 563059c4b9// need to wrap args in an arrayit.skip('should support invoking with arguments',()=>{constarray=[function(){returnslice.call(arguments)}],// actual = invokeMap(array, 'call', [null, 'a', 'b', 'c'])actual=invokeMap(array,'call',null,'a','b','c')
// TODO: test bug, implementation of invoke changed in 563059c4b9// need to wrap args in an arrayit.skip('should work with a function for `methodName`',()=>{constarray=['a','b','c']
// TODO: test bug, implementation of invoke changed in 563059c4b9// need to wrap args in an arrayit.skip('should work with an object for `collection`',()=>{constobject={'a': 1,'b': 2,'c': 3},// actual = invokeMap(object, 'toFixed', [1])actual=invokeMap(object,'toFixed',1)
test/isEmpty.test.js
// TODO: This test likely broke in commit 58e484f389.// The function `isEmpty` was modified, and the logic to filter out the 'constructor' property// when checking prototype objects seems to have been altered.// This is causing the test 'should work with prototype objects' to fail.it.skip('should work with prototype objects',()=>{functionFoo(){}Foo.prototype={'constructor': Foo}
test/isEqualWith.test.js
// TODO: this doesn't test what it says it doesit('should ensure `customizer` is a function',()=>{constarray=[1,2,3];
test/isMatchWith.test.js
// TODO: this test is realy only testing baseEquals, should be deletedit('should provide `stack` to `customizer`',()=>{letactual
// TODO: this test doens't test what it purports toit('should ensure `customizer` is a function',()=>{constobject={'a': 1};
test/isPlainObject.test.js
// TODO: this test likely broke in commit aa1d7d870d when switching from baseGetTag to getTagit.skip('should return `true` for objects with a writable `Symbol.toStringTag` property',()=>{if(Symbol&&Symbol.toStringTag){constobject={}object[Symbol.toStringTag]='X'
test/keyBy.test.js
// TODO: iteratee is not a functionit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constarray=[4,6,6],values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant({'4': 4,'6': 6}))
// TODO: iteratee is not a functionit.skip('should work with `_.property` shorthands',()=>{constexpected={'left': {'dir': 'left','code': 97},'right': {'dir': 'right','code': 100}},actual=keyBy(array,'dir')
// TODO: iteratee is not a functionit.skip('should work with a number for `iteratee`',()=>{constarray=[[1,'a'],[2,'a'],[2,'b']]
// TODO: iteratee is not a functionit.skip('should work in a lazy sequence',()=>{constarray=lodashStable.range(LARGE_ARRAY_SIZE).concat(lodashStable.range(Math.floor(LARGE_ARRAY_SIZE/2),LARGE_ARRAY_SIZE),lodashStable.range(Math.floor(LARGE_ARRAY_SIZE/1.5),LARGE_ARRAY_SIZE))
test/map.test.js
// TODO: implementation changed in 0bdc73195f // no longer accepts objects as inputit.skip('should map values in `collection` to a new array',()=>{// const object = { 'a': 1, 'b': 2 },constexpected=['1','2']
// TODO: iteratee is not a functionit.skip('should work with `_.property` shorthands',()=>{constobjects=[{'a': 'x'},{'a': 'y'}]assert.deepStrictEqual(map(objects,'a'),['x','y'])})
// TODO: implementation changed in 0bdc73195f // no longer accepts objects as inputit.skip('should iterate over own string keyed properties of objects',()=>{functionFoo(){this.a=1}Foo.prototype.b=2
// TODO: iteratee is not a functionit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constobject={'a': 1,'b': 2},values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant([1,2]))
// TODO: I forget what the bug is here, but I know I've seen this one before// same setup, with it not actually handling falseyit.skip('should accept a falsey `collection`',()=>{constexpected=lodashStable.map(falsey,stubArray)
// TODO: Borkedit.skip('should treat number values for `collection` as empty',()=>{assert.deepStrictEqual(map(1),[])})
// TODO: this one is just another slice undefined, but I am too tired to think about which slice to useit.skip('should provide correct `predicate` arguments in a lazy sequence',()=>{letargs,array=lodashStable.range(LARGE_ARRAY_SIZE+1),expected=[1,0,map(array.slice(1),square)]
test/mapKey.test.js
// TODO: iteratee is not a functionit.skip('should work with `_.property` shorthands',()=>{constactual=mapKey({'a': {'b': 'c'}},'b')assert.deepStrictEqual(actual,{'c': {'b': 'c'}})})
// TODO: iteratee is not a functionit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constobject={'a': 1,'b': 2},values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant({'1': 1,'2': 2}))
test/mapValue.test.js
// TODO: iteratee is not a functionit.skip('should work with `_.property` shorthands',()=>{constactual=mapValue({'a': {'b': 2}},'b')assert.deepStrictEqual(actual,{'a': 2})})
// TODO: iteratee is not a functionit.skip('should use `_.identity` when `iteratee` is nullish',()=>{constobject={'a': 1,'b': 2},values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant([true,false]))
test/matchesProperty.test.js
// TODO: failingit.skip('should match `undefined` values of nested objects',()=>{constobject={'a': {'b': undefined}};
test/meanBy.test.js
// TODO: iteratee is not a functionit.skip('should work with `_.property` shorthands',()=>{constarrays=[[2],[3],[1]]assert.strictEqual(meanBy(arrays,0),2)assert.strictEqual(meanBy(objects,'a'),2)})})
test/merge.test.js
// TODO: revisit.it.skip('should treat sparse array sources as dense',()=>{constarray=[1]array[2]=3
test/nth.test.js
// TODO: this fails, I think there was a change number coercion// it should coerce n to 0, but it is notit.skip('should coerce `n` to an integer',()=>{letvalues=falsey,expected=lodashStable.map(values,stubA)
test/nthArg.test.js
// TODO: so same as nth, this fails// I think I understand the intent though, it expects n to become 0// but it's not apparentlyit.skip('should coerce `n` to an integer',()=>{letvalues=falsey,expected=lodashStable.map(values,stubA)
test/number-coercion-methods.test.js
// TODO: welp, after going down a rabbit hole I realized that this test and the original// are using different assertions. The original uses deepEqual, this uses strictEqual// in deepEqual, these are equivalent [0, 0, 0, 0] [0, 0, -0, -0]// that's all, that's all it was// question is, do we fix the original or not? // for now Im going to make this deepEqual so the tests passit(`\`_.${methodName}\` should convert number primitives and objects to numbers`,()=>{constvalues=[2,1.2,MAX_SAFE_INTEGER,MAX_INTEGER,Infinity,NaN]
// TODO: same as above, this might also need to be changed to deepStrictEqual depending on where the implementation landsit(`\`_.${methodName}\` should convert string primitives and objects to numbers`,()=>{consttransforms=[identity,pad,positive,negative]
test/orderBy.test.js
// TODO: iteratee is not a functionit.skip('should sort by a single property by a specified order',function(){varactual=orderBy(objects,'a','desc');assert.deepStrictEqual(actual,[objects[1],objects[3],objects[0],objects[2]]);});
// TODO: failsit.skip('should sort by nested key in array format',()=>{varactual=orderBy(nestedObj,[['address','zipCode'],['address.streetName']],['asc','desc'],);assert.deepStrictEqual(actual,[nestedObj[2],nestedObj[3],nestedObj[1],nestedObj[0],nestedObj[4]]);});
// TODO: iteratee is not a functionit.skip('should sort by multiple properties by specified orders',function(){varactual=orderBy(objects,['a','b'],['desc','asc']);assert.deepStrictEqual(actual,[objects[3],objects[1],objects[2],objects[0]]);});
// TODO: iteratee is not a functionit.skip('should sort by a property in ascending order when its order is not specified',function(){varexpected=[objects[2],objects[0],objects[3],objects[1]],actual=orderBy(objects,['a','b']);
// TODO: iteratee is not a functionit.skip('should work with `orders` specified as string objects',function(){varactual=orderBy(objects,['a'],[Object('desc')]);assert.deepStrictEqual(actual,[objects[1],objects[3],objects[0],objects[2]]);});});
test/pad.test.js
// TODO: fails, doesn't call/access toString anywhere and not sure when it previously did// hmm maybe it's string length failing? how do we get the length of an object before it's stringified right?// yeah I think that's it, we aren't getting a string size from the object bc we are doing that before stringifyingit.skip('should coerce `string` to a string',()=>{constvalues=[Object(string),{'toString': lodashStable.constant(string)}],expected=lodashStable.map(values,stubTrue)
test/padEnd.test.js
// TODO: fails, doesn't call/access toString anywhere and not sure when it previously did// hmm maybe it's string length failing? how do we get the length of an object before it's stringified right?// yeah I think that's it, we aren't getting a string size from the object bc we are doing that before stringifyingit.skip('should coerce `string` to a string',()=>{constvalues=[Object(string),{'toString': lodashStable.constant(string)}],expected=lodashStable.map(values,stubTrue)
test/padStart.test.js
// TODO: fails, doesn't call/access toString anywhere and not sure when it previously did// hmm maybe it's string length failing? how do we get the length of an object before it's stringified right?// yeah I think that's it, we aren't getting a string size from the object bc we are doing that before stringifyingit.skip('should coerce `string` to a string',()=>{constvalues=[Object(string),{'toString': lodashStable.constant(string)}],expected=lodashStable.map(values,stubTrue)
test/parseInt.test.js
// TODO: I don't think it can based on current impl? Did impl change?// ah yes it did in 0bdc73195f // parseInt will get called with the value and index// so for '08' it gets parseInt('08', 1) // => NaN// for '10' it gets parseInt('08', 2) // => 2it.skip('should work as an iteratee for methods like `_.map`',()=>{letstrings=lodashStable.map(['6','08','10'],Object),actual=lodashStable.map(strings,parseInt)
test/partition.test.js
// TODO: predicate is not a functionit.skip('should use `_.identity` when `predicate` is nullish',()=>{constvalues=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant([[1,1],[0]]))
// TODO: iteratee is not a functionit.skip('should work with `_.property` shorthands',()=>{constobjects=[{'a': 1},{'a': 1},{'b': 2}],actual=partition(objects,'a')
// TODO: predicate is not a functionit.skip('should work with a number for `predicate`',()=>{constarray=[[1,0],[0,1],[1,0]]
test/pick.test.js
// TODO: flatrest was removed, so it's not flatteningit.skip('should flatten `paths`',()=>{assert.deepStrictEqual(pick(object,'a','c'),{'a': 1,'c': 3})assert.deepStrictEqual(pick(object,['a','d'],'c'),{'a': 1,'c': 3,'d': 4})})
// TODO: fails, is this related to shorthands being removed?it.skip('should support deep paths',()=>{assert.deepStrictEqual(pick(nested,'b.c'),{'b': {'c': 2}})})
// TODO: would have failed at 0acb2847bf when toString was removed from castPathit.skip('should work with `arguments` object `paths`',()=>{console.log({args})assert.deepStrictEqual(pick(object,args),{'a': 1,'c': 3})})})
test/random.test.js
// TODO: breaks because map is passing the array as the third arg// which breaks a check for if (floating || lower % 1 || upper % 1) {// since the array is truthy// related to map impl change?it.skip('should work as an iteratee for methods like `_.map`',()=>{constarray=[1,2,3],expected=lodashStable.map(array,stubTrue),randoms=lodashStable.map(array,random)console.log({randoms})constactual=lodashStable.map(randoms,(result,index)=>result>=0&&result<=array[index]&&(result%1)==0)
test/reduce.test.js
// TODO: iteratee is not a functionit.skip('should use the first element of a collection as the default `accumulator`',()=>{assert.strictEqual(reduce(array),1)})
test/reduceRight.test.js
// TODO: iteratee is not a functionit.skip('should use the last element of a collection as the default `accumulator`',()=>{assert.strictEqual(reduceRight(array),3)})
test/remove.test.js
// TODO: predicate is not a functionit.skip('should work with `_.matches` shorthands',()=>{constobjects=[{'a': 0,'b': 1},{'a': 1,'b': 2}]remove(objects,{'a': 1})assert.deepStrictEqual(objects,[{'a': 0,'b': 1}])})
// TODO: predicate is not a functionit.skip('should work with `_.matchesProperty` shorthands',()=>{constobjects=[{'a': 0,'b': 1},{'a': 1,'b': 2}]remove(objects,['a',1])assert.deepStrictEqual(objects,[{'a': 0,'b': 1}])})
// TODO: predicate is not a functionit.skip('should work with `_.property` shorthands',()=>{constobjects=[{'a': 0},{'a': 1}]remove(objects,'a')assert.deepStrictEqual(objects,[{'a': 0}])})
test/repeat.test.js
// TODO: coercion was removed in bb7c959479 it.skip('should treat falsey `n` values, except `undefined`, as `0`',()=>{constexpected=lodashStable.map(falsey,(value)=>value===undefined ? string : '')
// TODO: coercion was removed in bb7c959479 it.skip('should coerce `n` to an integer',()=>{assert.strictEqual(repeat(string,'2'),'abcabc')assert.strictEqual(repeat(string,2.6),'abcabc')assert.strictEqual(repeat('*',{'valueOf': stubThree}),'***')})
// TODO: fails, likely bc of map impl change where iteratee receives array as third argit.skip('should work as an iteratee for methods like `_.map`',()=>{constactual=lodashStable.map(['a','b','c'],repeat)assert.deepStrictEqual(actual,['a','b','c'])})})
test/sample.test.js
// TODO: sample stopped accepting object in cb7612aef6 it.skip('should sample an object',()=>{constobject={'a': 1,'b': 2,'c': 3},actual=sample(object)
test/sampleSize.test.js
// TODO: coercion was removed in bb7c95947914d1it.skip('should treat falsey `size` values, except `undefined`, as `0`',()=>{constexpected=lodashStable.map(falsey,(value)=>value===undefined ? ['a'] : [])
// TODO: object compat was removed in cb7612aef6it.skip('should sample an object',()=>{constobject={'a': 1,'b': 2,'c': 3},actual=sampleSize(object,2)
// TODO: fails, bc of map impl changesit.skip('should work as an iteratee for methods like `_.map`',()=>{constactual=lodashStable.map([['a']],sampleSize)assert.deepStrictEqual(actual,[['a']])})})
test/set-methods.test.js
// TODO: Ahh, this is grabbing off the lodash object from utils, which currently is stable lodashconstfunc=_[methodName],isUpdate=/^update/.test(methodName)
// TODO: this fails bc for _.update, returns an array with a hole in 0 index// which fails the assertion here. idk what intended is so dunno if test needs to be fixed or implit.skip(`\`_.${methodName}\` should create parts of \`path\` that are missing`,()=>{constobject={}
test/shuffle.test.js
// TODO: shuffle no longer supports objects since cb7612aef6it.skip('should contain the same elements after a collection is shuffled',()=>{assert.deepStrictEqual(shuffle(array).sort(),array)assert.deepStrictEqual(shuffle(object).sort(),array)})
test/slice-and-toArray.test.js
// TODO: this test implementation seems off// if the method should return a dense array, why are we comparing it's equality to a sparse one?it.skip(`\`_.${methodName}\` should return a dense array`,()=>{constsparse=Array(3)sparse[1]=2
test/slice.test.js
// TODO: coercion was removed in bb7c959479it.skip('should treat falsey `start` values as `0`',()=>{constexpected=lodashStable.map(falsey,lodashStable.constant(array))
// TODO: coercion was removed in bb7c959479it.skip('should coerce `start` and `end` to integers',()=>{constpositions=[[0.1,1.6],['0',1],[0,'1'],['1'],[NaN,1],[1,NaN]]
// TODO: map impl changedit.skip('should work as an iteratee for methods like `_.map`',()=>{constarray=[[1],[2,3]],actual=lodashStable.map(array,slice)
test/some.test.js
// TODO: predicate is not a functionit.skip('should use `_.identity` when `predicate` is nullish',()=>{letvalues=[,null,undefined],expected=lodashStable.map(values,stubFalse)
// TODO: predicate is not a functionit.skip('should work with `_.property` shorthands',()=>{constobjects=[{'a': 0,'b': 0},{'a': 0,'b': 1}]assert.strictEqual(some(objects,'a'),false)assert.strictEqual(some(objects,'b'),true)})
// TODO: predicate is not a functionit.skip('should work with `_.matches` shorthands',()=>{constobjects=[{'a': 0,'b': 0},{'a': 1,'b': 1}]assert.strictEqual(some(objects,{'a': 0}),true)assert.strictEqual(some(objects,{'b': 2}),false)})
// TODO: predicate is not a functionit.skip('should work as an iteratee for methods like `_.map`',()=>{constactual=lodashStable.map([[1]],some)assert.deepStrictEqual(actual,[true])})})
test/split.test.js
// TODO: broken in b8a3a422 when string coercion methods were removedit.skip('should return an array containing an empty string for empty values',()=>{constvalues=[,null,undefined,''],expected=lodashStable.map(values,lodashStable.constant(['']))
// TODO: map impl changedit.skip('should work as an iteratee for methods like `_.map`',()=>{conststrings=['abc','def','ghi'],actual=lodashStable.map(strings,split)
test/startsWith.test.js
// TODO: coercion was removed in bb7c959479it.skip('should treat falsey `position` values as `0`',()=>{constexpected=lodashStable.map(falsey,stubTrue)
test/sumBy.test.js
// TODO: iteratee is not a functionit.skip('should work with `_.property` shorthands',()=>{constarrays=[[2],[3],[1]]assert.strictEqual(sumBy(arrays,0),6)assert.strictEqual(sumBy(objects,'a'),6)})})
test/take.test.js
// TODO: map impl changedit.skip('should work as an iteratee for methods like `_.map`',()=>{constarray=[[1,2,3],[4,5,6],[7,8,9]],actual=lodashStable.map(array,take)
test/takeRight.test.js
// TODO: map impl changedit.skip('should work as an iteratee for methods like `_.map`',()=>{constarray=[[1,2,3],[4,5,6],[7,8,9]],actual=lodashStable.map(array,takeRight)
test/takeRightWhile.test.js
// TODO: predicate is not a functionit.skip('should work with `_.matches` shorthands',()=>{assert.deepStrictEqual(takeRightWhile(objects,{'b': 2}),objects.slice(2))})
// TODO: predicate is not a functionit.skip('should work with `_.matchesProperty` shorthands',()=>{assert.deepStrictEqual(takeRightWhile(objects,['b',2]),objects.slice(2))})
// TODO: predicate is not a functionit.skip('should work with `_.property` shorthands',()=>{assert.deepStrictEqual(takeRightWhile(objects,'b'),objects.slice(1))})
test/takeWhile.test.js
// TODO: predicate is not a functionit.skip('should work with `_.matches` shorthands',()=>{assert.deepStrictEqual(takeWhile(objects,{'b': 2}),objects.slice(0,1))})
// TODO: predicate is not a functionit.skip('should work with `_.property` shorthands',()=>{assert.deepStrictEqual(takeWhile(objects,'b'),objects.slice(0,2))})
test/toPath.test.js
// TODO: this might be failing bc of changes in b8a3a42278 to string coercion?it.skip('should handle complex paths',()=>{constactual=toPath('a[-1.23]["[\\"b\\"]"].c[\'[\\\'d\\\']\'][\ne\n][f].g')assert.deepStrictEqual(actual,['a','-1.23','["b"]','c',"['d']",'\ne\n','f','g'])})
test/todo/eqDeep.test.js
// TODO: this suite is using chaining, so it's using lodash itself, but is also using the method it's testing off// that lodash instance it's using for chaining. // The todo is to figure out how to handle this when testing each function as a unit
test/todo/lodash-methods.test.js
// TODO: Figure out why this fails with TypeError expected a function, from within lodash.createWrapit('should accept falsey arguments',()=>{constarrays=lodashStable.map(falsey,stubArray)
test/todo/method.test.js
// TODO: I don't really know what constant is doing hereimportconstantfrom'../constant.js'
test/todo/methodOf.test.js
// TODO: func.call is not a functionassert.strictEqual(methodOf(path),1)})})
test/todo/overArgs.test.js
// TODO: implementation change, transforms must be an array of funcs// introduced in commit 3b4cbc70e7 it.skip('should transform each argument',()=>{// const over = overArgs(fn, [doubled, square])constover=overArgs(fn,doubled,square)assert.deepStrictEqual(over(5,10),[10,100])})
// TODO: implementation change, transforms must be an array of funcs// introduced in commit 3b4cbc70e7 // can't read length from non array undefined// ahh, it also no longer uses identity, so this test fails // even after wrapping transforms in an arrayit.skip('should use `_.identity` when a predicate is nullish',()=>{// const over = overArgs(fn, [undefined, null])constover=overArgs(fn,undefined,null)assert.deepStrictEqual(over('a','b'),['a','b'])})
// TODO: this test doesn't seem correct, it's attempting 'a'.call etc// but shorthands are out anywaysit.skip('should work with `_.property` shorthands',()=>{// const over = overArgs(fn, ['b', 'a'])constover=overArgs(fn,'b','a')assert.deepStrictEqual(over({'b': 2},{'a': 1}),[2,1])})
// TODO: failsit.skip('should work with `_.matches` shorthands',()=>{constover=overArgs(fn,{'b': 1},{'a': 1})assert.deepStrictEqual(over({'b': 2},{'a': 1}),[false,true])})
// TODO: failsit.skip('should work with `_.matchesProperty` shorthands',()=>{constover=overArgs(fn,[['b',1],['a',1]])assert.deepStrictEqual(over({'b': 2},{'a': 1}),[false,true])})
// TODO: failsit.skip('should differentiate between `_.property` and `_.matchesProperty` shorthands',()=>{letover=overArgs(fn,['a',1])assert.deepStrictEqual(over({'a': 1},{'1': 2}),[1,2])
// TODO: does not flatten, not sure that it should?// implementation changedit.skip('should flatten `transforms`',()=>{constover=overArgs(fn,[doubled,square],String)assert.deepStrictEqual(over(5,10,15),[10,100,'15'])})
// TODO: implementation changed, transforms must be array of funcit.skip('should not transform any argument greater than the number of transforms',()=>{// const over = overArgs(fn, [doubled, square])constover=overArgs(fn,doubled,square)assert.deepStrictEqual(over(5,10,18),[10,100,18])})
// TODO: implementation changed, transforms must be array of func// it chokes bc it tries to read properties of undefined (reading 'length')it.skip('should not transform any arguments if no transforms are given',()=>{constover=overArgs(fn)assert.deepStrictEqual(over(5,10,18),[5,10,18])})
// TODO: implementation changed, transforms must be array of funcit.skip('should not pass `undefined` if there are more transforms than arguments',()=>{// const over = overArgs(fn, [doubled, identity])constover=overArgs(fn,doubled,identity)assert.deepStrictEqual(over(5),[10])})
// TODO: implementation changed, transforms must be array of funcit.skip('should provide the correct argument to each transform',()=>{constargsList=[],transform=function(){argsList.push(slice.call(arguments))},// over = overArgs(noop, [transform, transform, transform])over=overArgs(noop,transform,transform,transform)
// TODO: implementation changed, transforms must be array of funcit.skip('should use `this` binding of function for `transforms`',()=>{constover=overArgs(function(x){returnthis[x]// }, [function(x) {// return this === x// }])},function(x){returnthis===x})
test/todo/overEvery.test.js
// TODO: implementation change, transforms must be an array of funcs// introduced in commit 3b4cbc70e7 it.skip('should return `false` as soon as a predicate returns falsey',()=>{letcount=0,countFalse=function(){count++;returnfalse},countTrue=function(){count++;returntrue},// over = overEvery([countTrue, countFalse, countTrue])over=overEvery(countTrue,countFalse,countTrue)
test/todo/partial-methods.test.js
// TODO: we end up testing the barrel lodash we export from utils// not sure yet how I want to approach this, there is no mocking in the suites currently// so idk how I feel about this manual monkey patching.import{_,identity,slice}from'./utils';importplaceholderfrom'../placeholder.js';importcurryfrom'../curry.js';
// TODO: ahhh, these placeholder tests make more sense once you see the original Qunit test// https://github.com/lodash/lodash/blob/f299b52f39486275a9e6483b60a410e06520c538/test/test.js#L17414C5-L17429C8// the test was monkeypatching library internal _.placeholder, to test the behavior of these methodsit('`_.'+methodName+'` should use `_.placeholder` when set',function(){var_ph=placeholder={},fn=function(){returnslice.call(arguments);},par=func(fn,_ph,'b',ph),expected=isPartial ? ['a','b',ph,'c'] : ['a','c','b',ph];
test/todo/pullAt.test.js
// TODO: would have broken at aacfefc752 when flatRest was removedit.skip('should modify the array and return removed elements',()=>{constarray=[1,2,3],actual=pullAt(array,[0,1])
// TODO: would have broken at aacfefc752 when flatRest was removedit.skip('should work with unsorted indexes',()=>{constarray=[1,2,3,4,5,6,7,8,9,10,11,12],actual=pullAt(array,[1,3,11,7,5,9])
test/todo/sortBy-methods.test.js
// TODO: this test also is using the lodash object exported from utils
test/transform.test.js
// TODO: iteratee is not a functionit.skip('should ensure `object` is an object before using its `[[Prototype]]`',()=>{letCtors=[Boolean,Boolean,Number,Number,Number,String,String],values=[false,true,0,1,NaN,'','a'],expected=lodashStable.map(values,stubObject)
// TODO: iteratee is not a functionit.skip('should ensure `object` constructor is a function before using its `[[Prototype]]`',()=>{Foo.prototype.constructor=nullassert.ok(!(transform(newFoo)instanceofFoo))Foo.prototype.constructor=Foo})
// TODO: iteratee is not a functionit.skip('should create an object from the same realm as `object`',()=>{constobjects=lodashStable.filter(realm,(value)=>lodashStable.isObject(value)&&!lodashStable.isElement(value))
test/unionBy.test.js
// TODO: iteratee is not a functionit.skip('should accept an `iteratee`',()=>{letactual=unionBy([2.1],[1.2,2.3],Math.floor)assert.deepStrictEqual(actual,[2.1,1.2])
// TODO: iteratee is not a functionit.skip('should provide correct `iteratee` arguments',()=>{letargs
// TODO: iteratee is not a functionit.skip('should output values from the first possible array',()=>{constactual=unionBy([{'x': 1,'y': 1}],[{'x': 1,'y': 2}],'x')assert.deepStrictEqual(actual,[{'x': 1,'y': 1}])})})
test/unset.test.js
// TODO: fails, not sure why, maybe the string coercion change again?it.skip('should handle complex paths',()=>{constpaths=['a[-1.23]["[\\"b\\"]"].c[\'[\\\'d\\\']\'][\ne\n][f].g',['a','-1.23','["b"]','c',"['d']",'\ne\n','f','g']]
// TODO: this one gives a type error, which is expected in strict mode// and since we're running these tests in an ESM like context (using esm module with mocha), strict mode is on// TypeError: Cannot delete property 'a' of #<Object>it.skip('should return `false` for non-configurable properties',()=>{constobject={}
test/unzipWith.test.js
// TODO: maybe this broke in 37f168d466 when apply was removed?// it attempts to call apply on the undefined iterateeit.skip('should perform a basic unzip when `iteratee` is nullish',()=>{constarray=[[1,3],[2,4]],values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant(unzip(array)))
test/xorBy.test.js
// TODO: iteratee is not a functionit.skip('should accept an `iteratee`',()=>{letactual=xorBy([2.1,1.2],[2.3,3.4],Math.floor)assert.deepStrictEqual(actual,[1.2,3.4])
test/zipWith.test.js
// TODO: maybe this broke in 37f168d466 when apply was removed?// it attempts to call apply on the undefined iterateeit.skip('should perform a basic zip when `iteratee` is nullish',()=>{constarray1=[1,2],array2=[3,4],values=[,null,undefined],expected=lodashStable.map(values,lodashStable.constant(zip(array1,array2)))