Open eau-de-la-seine opened 2 years ago
I just ran into this myself. Try instantiating the MockAdapter
with the new
keyword:
let mockServer = new MockAdapter(axios)
👆
Tangentially, I had to use the result of axios.create()
, which returns an AxiosInstance
, instead of plain axios
which is typed as AxiosStatic
.
Hello Colin,
Encountered error:
TypeError: Cannot set property 'handlers' of undefined
Project type: Back-end NodeJS with ES6 modules
Dependencies:
axios
version^0.27.2
axios-mock-adapter
version^1.21.1
jasmine
version^4.2.1
(the only JS test framework that works properly with ES6 modules and without transpilers)Code:
Stacktrace: