Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mocha test not running Chai assertion using Meteor

For my project, I am trying to set up Mocha to run Chai tests, but am having an issue where the tests are simply not running at all. The browser reports that no tests are passing, failing, or running.

Here is the code for the tests:

import {assert} from 'chai';
import {Meteor} from 'meteor/meteor';

if (Meteor.isclient) {

    describe('Recipe model', function () {
        it('should test that a recipe is created', function () {
            assert.isTrue(true);
        });
    });
}

I run the test using the following command:

    meteor test --driver-package practicalmeteor:mocha

I have installed practicalmeteor:chai as well. A google search suggested putting chai.should() at the beginning of my test, but that did not help. I am open to all suggestions.

Cheers!

like image 249
Shyyk Avatar asked Oct 30 '22 02:10

Shyyk


1 Answers

One of possible issues is typo at 4th line of your code: replace Meteor.isclient with Meteor.isClient. Your test even didn't executed because Meteor.isclient was always false.

like image 90
LazyCat01 Avatar answered Nov 12 '22 17:11

LazyCat01