mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 08:36:26 +00:00
18 lines
502 B
TypeScript
18 lines
502 B
TypeScript
import { getName } from '../../test/util';
|
|
import { hasKey } from './object';
|
|
|
|
describe(getName(), () => {
|
|
beforeEach(() => {
|
|
jest.resetModules();
|
|
});
|
|
|
|
it('finds key in regular object', () => {
|
|
expect(hasKey('foo', { foo: true })).toBeTrue();
|
|
});
|
|
it('detects missing key in regular object', () => {
|
|
expect(hasKey('foo', { bar: true })).toBeFalse();
|
|
});
|
|
it('returns false for wrong instance type', () => {
|
|
expect(hasKey('foo', 'i-am-not-an-object')).toBeFalse();
|
|
});
|
|
});
|