【发布时间】:2015-06-27 20:21:00
【问题描述】:
我正在使用 mocha 和 coffeescript 编写一个简单的测试脚本。
在我的测试文件夹中,我有一个 mocha 的配置(mocha.opts):
--compilers coffee: coffee-script/register
--reporter spec
还有我的测试文件(test_one.coffee):
assert = require "assert"
describe "A feature", ->
describe "An specific function", ->
it "Should work as expected", ->
assert true
但每当我运行“mocha”时。它返回给我:
assert.js:93
throw new assert.AssertionError({
AssertionError: missing path
at Module.require (module.js:363:3)
at require (module.js:380:17)
at args (C:\...\AppData\Roaming\npm\node_modules\mocha\bi
at Array.forEach (native)
at Object.<anonymous> (C:\...\AppData\Roaming\npm\node_mo
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
关于如何解决此问题的任何想法?
【问题讨论】:
标签: javascript node.js coffeescript mocha.js assert