2016-06-28 8 views
0

私はReactが付いたMeteor Applicationを実行していて、Mochaで試験を書き始めています。現在、私は何もテストしない基本テストをしています。酵素を使った流行/反応モカ試験 - モジュールが見つからない '

クライアント/展望/ ProspectForm.tests.jsx

import React from 'react'; 
import { shallow } from 'enzyme'; 

describe('<Foo />',() => { 

    it('calls componentDidMount',() => { 
    }); 

}); 

私は私のテストサーバーを起動すると、私は次のエラー

error

モジュールを見つけることができません取得 'を持ちます'。問題は酵素に由来するようですが、新しい流星アプリケーションを作成し、酵素と実用性を追加すると:mochaと同じテストを追加するので、このアプリケーションで自分の環境と何か関係があるはずです。ここで

は私の流星パッケージがファイルであるここに私のpackage.json

{ 
    "name": "myApp", 
    "private": true, 
    "scripts": { 
    "start": "meteor run" 
    }, 
    "dependencies": { 
    "material-ui": "^0.15.0", 
    "meteor-node-stubs": "~0.2.0", 
    "react": "^15.0.2", 
    "react-addons-pure-render-mixin": "^15.0.1", 
    "react-datepicker": "^0.27.0", 
    "react-dom": "^15.0.2", 
    "react-mounter": "^1.2.0", 
    "react-s-alert": "^1.1.4", 
    "react-tap-event-plugin": "^1.0.0" 
    }, 
    "devDependencies": { 
    "enzyme": "^2.3.0" 
    } 
} 

あると

# edgee:slingshot       # Send files to storage service. 
# peerlibrary:aws-sdk      # Amazon SDK for S3/EC2/etc... 


# CORE PACKAGES 
meteor-base        # Meteor platform 
mobile-experience       # Mobile Optimizations 
logging         # Meteor internal logging 
ejson          # Extends JSON Types 
tracker         # Reactive Data Sources 
email          # Send emails 
accounts-password       # Authentication for users. 
es5-shim         # ECMAScript 5 compatibility for older browsers. 
ecmascript        # Enable ECMAScript2015+ syntax 
standard-minifier-css      # CSS Minification 
standard-minifier-js      # Javascript Minification 
static-html        # Adds global head tag 
reload         # Active reload 
react-meteor-data       # Used for react data mixins 

stevezhu:lodash       # Javascript utility library. 
momentjs:moment       # Date library for Javascript. 
johnantoni:meteor-normalize    # normalizes css 
fourseven:scss       # SASS stylesheets. 
fortawesome:fontawesome     # Icons. 
natestrauser:animate-css     # Animations using CSS. 
mongo          # Mongo DB 
aldeed:collection2      # Schemas and validations for database collections. 
dburles:collection-helpers    # Create data helpers in ./lib available to client and server. 
meteortoys:allthings      # A number of helpers for deveopment. Activate with control+m 
kadira:flow-router      # Router. 
mystor:device-detection     # Detect device user is using. 
semantic:ui-css 
practicalmeteor:mocha 

誰もがここで何が起こっているか任意のアイデアを持っていますか?

答えて

1

あなたは既にそれらを持っていない場合もthese 2 dependenciesをインストールする必要があります:あなたは、DOMを反応させてきたが、あなたはテスト-utilsの欠けているように

npm i --save-dev react-addons-test-utils 
npm i --save-dev react-dom 

が見えます。

+0

返信いただきありがとうございます。私はしばらく前に私の支店をリセットしてからやり直しました。それはまだそれで動作しませんでした、仕事を終了したのは流星の更新を実行していた。 – ruevaughn

0

実行中の流星の更新は私のためにこれを解決しました。私はDavinが言ったことをしなくてはなりませんでした。

関連する問題