I finally cracked it, I can't answer why my previous jest test worked on Windows and not my Mac, but https://stackoverflow.com/a/62777134/6260882, specifically: 'axios is a function, not an object'. I was able to get my mocks to work like this:
jest.mock('axios', () => Object.assign(jest.fn(), {
post: jest.fn(() => Promise.resolve({ data: sessionKey })),
isAxiosError: jest.fn(),
}));
But I had problems being able to change the mocks on the fly because jest.mock is hoisted to the top. So I eventually decided to use AxiosMockAdapter since it had built in what I was trying to replicate.
test.spec.ts
import AxiosMockAdapter from 'axios-mock-adapter';
...
const mockedAxios = new AxiosMockAdapter(axios);
...
mockedAxios.onPost().reply(200, sessionKey);