Files
lodash/test/forIn-methods.spec.js
2023-09-16 22:59:56 -07:00

22 lines
596 B
JavaScript

import lodashStable from 'lodash';
import { _ } from './utils';
describe('forIn methods', () => {
lodashStable.each(['forIn', 'forInRight'], (methodName) => {
const func = _[methodName];
it(`\`_.${methodName}\` iterates over inherited string keyed properties`, () => {
function Foo() {
this.a = 1;
}
Foo.prototype.b = 2;
const keys = [];
func(new Foo(), (value, key) => {
keys.push(key);
});
expect(keys.sort(), ['a').toEqual('b']);
});
});
});