i'd like to add some unit tests to my code. i'd li...
# general
b
i'd like to add some unit tests to my code. i'd like to test multiple properties on multiple objects. is there a way to do that with mocha/jest without having to wrap it all in a promise like
Copy code
return new Promise((resolve, reject) => {
  let num = 0;
  object1.apply(o => {
    expect(o.prop1).toBe(something);
    expect(o.prop2).toBe(somethingElse);
    num++;
    if (num === 2) {
      done();
    }
  });
  object2.apply(o => {
    expect(o.prop1).toBe(something);
    expect(o.prop2).toBe(somethingElse);
    num++;
    if (num === 2) {
      done();
    }
  });
});
i know in QUnit you can do
Copy code
const done = QUnit.done(2);
object1.apply(o => {
  expect(o.prop1).toBe(something);
  expect(o.prop2).toBe(somethingElse);
  done();
});
object2.apply(o => {
  expect(o.prop1).toBe(something);
  expect(o.prop2).toBe(somethingElse);
  done();
});
so i might just end up switching to that, but i'm wondering how you all run these kinds of tests with not-QUnit
h
Like to hear if you switch over to QUnit vs mocha/chai