samedi 28 janvier 2017

How do you convert a mocha unit test into a mocha testcheck test?

I may be misinformed in how this all works, but from what I understand, when you create a mocha testcheck test, you need to enter your information in a completely different syntax then when you do when you make a straight up mocha test.

The mocha test I have right now looks something like this:

{ should: 'return true bold', criteria: {rules: [{label: '<b>word</b>'}]}, attempt: {answer: '<b>word</b>'}, expected: true },

I'm looking at the example that is in the mocha-testcheck documentation, and the example looks like this:

describe('MySpec', function () {

  check.it('accepts an int and a string', [gen.int, gen.string], function (x, y) {
    assert(typeof x === 'number');
    assert(typeof y === 'string');
  });

});

is there any way to easily convert what I have into what the second example indicates?

Thanks in advance!!!

Aucun commentaire:

Enregistrer un commentaire