Bug of IPFS.create method

I’m unable to get a working unit test that calls IPFS.create(). There has to be something obvious that I’m not aware of, but for the life of me I cannot find it.

// the unit tests

test('Test IPFS create method', async () => {
    // expect.assertions(1);
    const mockCreateIpfs = jest.fn(async () => await createIpfs());

    await mockCreateIpfs();

test("Read the latest", async () => {
    const mockGetLatest = jest.fn(async () => await getLatest());

    await mockGetLatest();


// the functions

export async function createIpfs(props = {}) {
  const memo = String(Object.entries(props)) || 'createIpfs';

  if (memo in ipfsCreateMemo === false) {
      console.log(Object.keys(IPFS)); // This verifies that IPFS is imported correctly
      // The error always happens next
      ipfsCreateMemo[memo] = await IPFS.create();
  // never gets to this point
  return ipfsCreateMemo[memo];

export async function getLatest() {
  const ipfs = await createIpfs();

  return ipfs.refs.local();

The first error is digest should be a Uint8Array. If I test anything that calls IPFS.create after that I will get LockExistsError: Lock already being held for file: /home/jhale/.jsipfs/repo.lock.

How can I get this unit test to pass using IPFS.create?

You should actually enter LockExistsError: into the search field of this forum and find lots on this. Someone had a problem just last week that I think was a result of opening an IPFS instance when one is already open. It only allows one instance at a time to exist, I think.

There is nothing for digest should be a Uint8Array. That’s my primary concern because it is the first error. Should I be thinking differently about that error?