骨干摩卡测试:“app未定义”

时间:2013-10-03 18:05:02

标签: javascript node.js backbone.js mocha

我只是尝试运行一个简单的测试来确保我的应用程序的全局命名空间存在。但我一直没有定义"应用程序未定义"错误。

测试/ test.js

var chai = require('chai');
var assert = chai.assert,
expect = chai.expect,
should = chai.should();


describe("Application", function() {
    it("creates a global variable for the name space", function() {
        should.exist(app);
    })
});

JS / app.js

if (typeof app === "undefined") app = {};

0 个答案:

没有答案
相关问题