mardi 21 novembre 2017

Testing in Meteor

I am trying to add tests in Meteor. I added my tests in the folder 'imports'. This is the test file:

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);
        })
      });
    });
  });
}

I tried to call a method and log the result but I get the following error:

There is no route for the path: /

The result from the console log is:

error {"isClientSafe":true,"error":404,"reason":"Method 'getVideoData' not found","message":"Method 'getVideoData' not found [404]","errorType":"Meteor.Error"}

and

ok undefined

I used Meteor for the back end and React for the front end.

Am I missing something in the test file or is it related to something else?

This is the link to the repo github

Aucun commentaire:

Enregistrer un commentaire