受け入れテストではcucumber-jsを使用し、ページでは "unit"テストではmochaを使用する場合は、cuked-zombie(広告には申し訳ありません)を使用できます。
次に、このようなあなたのユニットテストでゾンビとのモカを使用
`/* globals __dirname */
var os = require('os');
var path = require('path');
module.exports = {
cli: null,
domain: 'addorange-macbook': 'my-testing-domain.com',
debug: false
};
をgithubの上のreadmeに記述のようにそれをインストールしますが、あなたの世界の設定が世界的にあるconfig.jsというファイルに配置します。
var chai = require('chai'), expect = chai.expect;
var cukedZombie = require('cuked-zombie');
describe('Apopintments', function() {
describe('ArrangeFormModel', function() {
before(function(done) { // execute once
var that = this;
cukedZombie.infectWorld(this, require('../world-config'));
this.world = new this.World(done);
// this inherits the whole world api to your test
_.merge(this, this.world);
});
describe("display", function() {
before(function(done) { // executed once before all tests are run in the discribe display block
var test = this;
this.browser.authenticate().basic('maxmustermann', 'Ux394Ki');
this.visitPage('/someurl', function() {
test.helper = function() {
};
done();
});
});
it("something on the /someurl page is returned", function() {
expect(this.browser.html()).not.to.be.empty;
});
私の答えは、あなたが念頭に置いていたものでしたか? – Industrial
うん、それは私が望んだことだ。ありがとう! – Joel