【发布时间】:2012-04-22 08:06:46
【问题描述】:
这个问题可能是因为我以前缺乏使用 node.js 的经验,但我希望 jasmine-node 能让我从命令行运行我的 jasmine 规范。
TestHelper.js:
var helper_func = function() {
console.log("IN HELPER FUNC");
};
my_test.spec.js:
describe ('Example Test', function() {
it ('should use the helper function', function() {
helper_func();
expect(true).toBe(true);
});
});
这是目录中仅有的两个文件。然后,当我这样做时:
jasmine-node .
我明白了
ReferenceError: helper_func is not defined
我确信这个问题的答案很简单,但我没有在 github 上找到任何超级简单的介绍或任何明显的内容。任何建议或帮助将不胜感激!
谢谢!
【问题讨论】:
标签: javascript unit-testing testing node.js jasmine