meteor / todos

The example app "Todos", written following the Meteor Guide
Other
535 stars 367 forks source link

When we are using assert and when we are using chai in Testing #235

Closed ghost closed 7 years ago

ghost commented 7 years ago

Please explain when we are using assert and when we are using chai

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

hwillson commented 7 years ago

assert is part of the chai library. Based on how the chai devs have set their package up, you can either import assert directly like this:

import { assert } from 'meteor/practicalmeteor:chai';
assert.equal(...);

or just import chai and reference assert from it, like:

import { chai } from 'meteor/practicalmeteor:chai';
chai.assert.equal(...);

todos uses both styles.

Again though, usability questions like this are much better suited for the Meteor forums (issues here are reserved for bugs / feature requests).