Shyyk Shyyk - 6 months ago 38
Javascript Question

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 () {

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.



Turns out I had weird issues with importing assert. I just had to do the following as noted from @Tdm:

import {chai} from 'meteor/practicalmeteor:chai'