私はすべての関連記事を読んでいますが、私の状況には適していないようです。mocha "describe"は定義されていません
私は流星を使用して、私は私の流星ルートディレクトリに/test
フォルダを作成しているnpm
で"mocha": "^3.5.0"
パッケージをインストールしました。 とサンプルテストmochatest.js
var assert = require("assert"); // node.js core module
describe('Array', function(){
describe('#indexOf()', function(){
it('should return -1 when the value is not present', function(){
assert.equal(-1, [1,2,3].indexOf(4)); // 4 is not present in this array so indexOf returns -1
})
})
});
私はテストパスモカを実行します。私は私の通常のサーバを起動するとき
は、しかし、私は得る:ReferenceError: describe is not defined
.meteor/packages/meteor-tool/.1.3.5_1.1wj76e8++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280 throw(ex); ^ ReferenceError: describe is not defined at meteorInstall.test.mochatest.js (test/mochatest.js:3:1) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1) at project-i18n.js:6:1 at .meteor/local/build/programs/server/boot.js:297:10 at Array.forEach (native) at Function._.each._.forEach (.meteor/packages/meteor-tool/.1.3.5_1.1wj76e8++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11) at .meteor/local/build/programs/server/boot.js:133:5
私は流星が起動時にテストを実行したいが、モカのものを見つけることができない気持ちを持っています。
どうすればよいですか?
どのようにテストケースを実行していますか? –
私はアプリケーションルートディレクトリに 'mocha'と入力するだけで実行します – Gobliins
私はテストスイートを設定するのは非常にスタートしていますので、私はこのテストのatmしか持っていません。 – Gobliins