UNPKG

msw

Version:

Seamless REST/GraphQL API mocking library for browser and Node.js.

17 lines (14 loc) 407 B
import { hasRefCounted } from './hasRefCounted' it('returns true for objects with ref and unref methods', () => { expect( hasRefCounted({ ref() {}, unref() {}, }), ).toBe(true) }) it('returns false for a non-refcounted object', () => { expect(hasRefCounted({})).toBe(false) expect(hasRefCounted({ ref() {} })).toBe(false) expect(hasRefCounted({ unref() {} })).toBe(false) })