【发布时间】:2017-11-21 10:33:04
【问题描述】:
我正在尝试在 Meteor 中添加测试。我在“imports”文件夹中添加了我的测试。这是测试文件:
import { Meteor } from 'meteor/meteor';
import { chai } from 'meteor/practicalmeteor:chai';
if (Meteor.isClient) {
describe('Client Tasks', () => {
describe('methods', () => {
it('can delete owned task', () => {
Meteor.call('getVideoData', function (error, res) {
if (error) console.log('error', error)
console.log('ok', res);
})
});
});
});
}
我尝试调用一个方法并记录结果,但出现以下错误:
路径没有路由:/
控制台日志的结果是:
错误 {"isClientSafe":true,"error":404,"reason":"方法 'getVideoData' 未找到","message":"方法 'getVideoData' 未找到 [404]","errorType": “流星.错误”}
和
好的未定义
我用 Meteor 做后端,用 React 做前端。
我是在测试文件中遗漏了某些内容还是与其他内容有关?
这是回购链接github
【问题讨论】: