Coffeescript DocPad插件:测试时出现奇数错误,包含在项目中时挂起

Coffeescript DocPad插件:测试时出现奇数错误,包含在项目中时挂起,coffeescript,docpad,Coffeescript,Docpad,我正在尝试编写一个DocPad插件,将MongoDB文档导入DocPad数据库,以便在静态网站中使用。源代码位于,并且基于 当我运行蛋糕测试时,我得到以下输出: cake compile cake install npm install (for app) npm install (for test) npm install (for docpad tests) coffee compile npm test > docpad-plugin-mongodb@2.0.0 test c:\U

我正在尝试编写一个DocPad插件,将MongoDB文档导入DocPad数据库,以便在静态网站中使用。源代码位于,并且基于

当我运行蛋糕测试时,我得到以下输出:

cake compile
cake install
npm install (for app)
npm install (for test)
npm install (for docpad tests)
coffee compile
npm test

> docpad-plugin-mongodb@2.0.0 test c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> npm run prepare_test_db && node ./out/mongodb.test.js


> docpad-plugin-mongodb@2.0.0 prepare_test_db c:\Users\IBM_ADMIN\docpad-plugin-mongodb
> mongo test/prepare_database.mongo.js

MongoDB shell version: 2.6.5
connecting to: test
connecting to: docpad_plugin_mongodb_test
mongodb
mongodb > create
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docpad.org/donate
error: An error occured:
Error: Didn't place the skeleton as the desired structure already exists
  at c:\Users\IBM_ADMIN\docpad-plugin-mongodb\node_modules\docpad\out\lib\docpad.js:4107:17
  at Object.cb [as oncomplete] (fs.js:168:19)
error: To report the above error, follow the guide at: http://docpad.org/bug-report
mongodb > create OK
mongodb > load plugin mongodb
mongodb > load plugin mongodb OK
mongodb > generate
mongodb > generate > action
warning: You have multiple files being written to c:\Users\IBM_ADMIN\docpad-plugin-mongodb\test\out\testData\1.json, they are:
  - testData/1.json:c7
  - testData/1.json:c5
  Rename one of them to avoid an over-write

FAILURE: 2/3 tests ran successfully; 0 failed, 1 incomplete, 0 errors

npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:99
      throw err;
            ^
Error: Process exited with error status code
  at ChildProcess.<anonymous> (c:\Users\IBM_ADMIN\docpad-plugin-mongodb\Cakefile:88:15)
  at ChildProcess.emit (events.js:98:17)
  at maybeClose (child_process.js:756:16)
  at Process.ChildProcess._handle.onexit (child_process.js:823:5)
(如果我访问localhost:9778,它只是挂起,从不加载页面)

它似乎只在第一次完成后才显示插件的日志,所以我开始添加
throw
语句来查看它在做什么。它似乎成功地从mongo导入了东西,并创建了文档,但当插件调用时,该回调永远不会被触发


有人能给我提供一些指导,告诉我我搞砸了什么,以及如何让事情顺利进行吗?

修复了它。任务组库(显然)曾经有一个不再工作的
.once('complete',callback)
事件。切换到
.done(回调)
(并修复了几个其他小错误)让我现在可以工作了

它仍然给我“错误:没有放置骨架,因为所需的结构已经存在”,但是现在测试都通过了,所以我称之为胜利

$ docpad run
info: Welcome to DocPad v6.69.1 (local installation: c:\Users\IBM_ADMIN\watson-developer-cloud\node_modules\docpad
notice: If everyone who saw this message donated $1/week, maintaining DocPad would become sustainable: http://docp
info: Contribute: http://docpad.org/docs/contribute
info: Plugins: eco, mongodb
info: Environment: development
info: DocPad listening to http://0.0.0.0:9778/ on directory c:\Users\IBM_ADMIN\watson-developer-cloud\out