mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
wip: code formatting nits continued
This commit is contained in:
21
test/forIn-methods.spec.js
Normal file
21
test/forIn-methods.spec.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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']);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user