Я пытаюсь подделать запрос с библиотекой Nock в моем приложении React (WebPack), но я получаю ошибки: «Assert не определяется» и, после добавления пакета «Assert», «процесс не определяется», где я требует или импортируется «нок». < /p>
require('nock')
.nock('...')
.post('...')
.reply(200, {
myName: 'asdasd'
});
util.js:109 Uncaught ReferenceError: process is not defined
at ./node_modules/util/util.js (util.js:109:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/assert/build/internal/assert/assertion_error.js (assertion_error.js:25:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/assert/build/assert.js (assert.js:39:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
Подробнее здесь: https://stackoverflow.com/questions/795 ... pplication