1.2.0 • Published 5 years ago

tiny-describe v1.2.0

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

tiny-describe

description

This is a tiny test framework which you can run at runtime or a development environment.

It just help you to organize your assert and make sure they are called in ordered sequence with async/await.

It is good for a simple or temp use, but if you want to build a well featured test, use other test frameworks like Mocha, Jest.

use

const describe = require('tiny-describe');
const assert = require('assert');
describe('some spec name', async describe => {
  assert.equal(1, 1);

  // all inner describe should called with await
  await describe('some sub spec', () => {
    assert.equal(1 * 1 , 1);
  });
});

more usage you can see the demo/ folder

demo/failed-with-throw is a demo for a well formatted output of all spec's test status, but it will not throw any exception

npm.io

demo/failed-without-thorw.js is a demo that will thorw an error for the first spec error and stop the rest test

npm.io