2
모카로 반응 성분에 대한 테스트를 시작했습니다. 내가 NPM 테스트를 시작했을 때 그리고 제가 테스트 파일에 기록 객체를 연결을 시도했다반응 성분의 모카 테스트 기록
Invariant Violation: Browser history needs a DOM
예외 가지고 :
import React, {Component} from 'react'
import Modal from 'react-modal';
import expect from 'expect'
import TestUtils from 'react-addons-test-utils'
import {AdminPage} from '../../app/DOM/pages/AdminPanel'
const history = require('history');
const historyObj = history.createMemoryHistory();
historyObj.createLocation('/admin');
을하지만 I'v 다시이 예외를 얻었다. 어떻게이 문제를 해결할 수 있습니까?
당신은'createMemoryHistory()'대신에 테스트에서'createHistory()'를 사용하고 있습니까? 후자는 그 오류를 던지지 않습니다. – robertklep