1

我只是想运行一个简单的测试来确保我的应用程序的全局命名空间存在。但我不断收到“应用程序未定义”错误。

测试/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 = {};
4

0 回答 0