1.0.0-rc.9 • Published 7 years ago

asia v1.0.0-rc.9

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
7 years ago

asia npm version github release License

Blazingly fast, magical and minimalist testing framework for Today and Tomorrow

Please consider following this project's author, Charlike Mike Reagent, and :star: the project to show your :heart: and support.

Code style CircleCI linux build CodeCov coverage status DavidDM dependency status Renovate App Status Make A Pull Request Semantically Released

If you have any how-to kind of questions, please read the Contributing Guide and Code of Conduct documents.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Become a Patron Conventional Commits NPM Downloads Weekly NPM Downloads Monthly NPM Downloads Total Share Love Tweet

Project is semantically & automatically released on CircleCI with new-release and its New Release GitHub App.

Table of Contents

(TOC generated by verb using markdown-toc)

Install

This project requires Node.js ^8.10.0 || >=10.13.0. Install it using yarn or npm.
We highly recommend to use Yarn when you think to contribute to this project.

$ yarn add asia

API

Generated using docks.

src/api.js

Asia

Constructor which can be initialized with optional options object. On the .test method you can access the skip and todo methods. For example .test.skip(title, fn) and .test.todo(title).

Params

  • options {object} control tests concurrency or pass serial: true to run serially.

Returns

  • object instance with .test, .skip, .todo and .run methods

Examples

import Asia from 'asia/src/api';

// or in CommonJS
// const Asia = require('asia/cjs/api');

const api = Asia({ serial: true });
console.log(api);
// => { test() {}, skip() {}, todo() {}, run() {} }

api.test('awesome test', async () => {
  await Promise.resolve(123);
});

api.test.skip('some skip test here', () => {
  console.log('this will not log');
});
api.skip('same as above', () => {
  console.log('this will not log');
});

api.test.todo('test without implementaton');
api.todo('test without implementaton');

process.nextTick(() => {
  api.run();
});

test

Define a regular test with title and fn. Both title and fn params are required, otherwise it will throw. Optionally you can pass settings options object, to make it a "skip" or a "todo" test. For example { skip: true }

Params

  • title {string}
  • fn {function}
  • settings {object}

Examples

import test from 'asia';

test('some awesome failing test', (t) => {
  t.is(1, 2);
});

test('foo passing async test', async () => {
  const res = await Promise.resolve(123);

  t.is(res, 123);
});

test.skip

Define test with title and fn that will never run, but will be shown in the output.

Params

  • title {string} test title
  • fn {function} test function implementaton

Examples

import test from 'asia';

test.skip('should be skipped, but printed', () => {
  throw Error('test function never run');
});

test.skip('should throw, because expect test implementation');

test.todo

Define a test with title that will be marked as "todo" test. Such tests do not have test implementaton function, if fn is given than it will throw an error.

Params

  • title {string} title of the "todo" test
  • fn {function} do not pass test implementaton function

Examples

import test from 'asia';

test.todo('should be printed and okey');

test.todo('should throw, because does not expect test fn', (t) => {
  t.ok(true);
});

run

Run all tests, with optional settings options. Currently the supported options are serial and concurrency.

Params

  • settings {object} for example, pass serial: true to run the tests serially

Returns

  • Promise

back to top

See Also

Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!

back to top

Contributing

Follow the Guidelines

Please read the Contributing Guide and Code of Conduct documents for advices.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Support the project

Become a Partner or Sponsor? :dollar: Check the Partner, Sponsor or Omega-level tiers! :tada: You can get your company logo, link & name on this file. It's also rendered on package page in npmjs.com and yarnpkg.com sites too! :rocket:

Not financial support? Okey! Pull requests, stars and all kind of contributions are always welcome. :sparkles:

OPEN Open Source

This project is following OPEN Open Source model

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders.

There are a few basic ground-rules for its contributors

  1. Any significant modifications must be subject to a pull request to get feedback from other contributors.
  2. Pull requests to get feedback are encouraged for any other trivial contributions, but are not required.
  3. Contributors should attempt to adhere to the prevailing code-style and development workflow.

Wonderful Contributors

Thanks to the hard work of these wonderful people this project is alive! It follows the all-contributors specification.
Don't hesitate to add yourself to that list if you have made any contribution! ;) See how, here.

Charlike Mike Reagent💻 📖 💬 👀 🔍

Consider showing your support to them. :sparkling_heart:

License

Copyright (c) 2016-present, Charlike Mike Reagent <mameto2011@gmail.com> & contributors.
Released under the Apache-2.0 License.

2.2.1

3 years ago

2.2.0

3 years ago

2.0.2

3 years ago

2.4.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

3.2.0

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.3.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.1.3

3 years ago

2.1.0

3 years ago

3.3.0

3 years ago

3.1.0

3 years ago

1.0.0-rc.31

7 years ago

1.0.0-rc.30

7 years ago

1.0.0-rc.25

7 years ago

1.0.0-rc.24

7 years ago

1.0.0-rc.23

7 years ago

1.0.0-rc.22

7 years ago

1.0.0-rc.21

7 years ago

1.0.0-rc.20

7 years ago

1.0.0-rc.19

7 years ago

1.0.0-rc.18

7 years ago

1.0.0-rc.17

7 years ago

1.0.0-rc.16

7 years ago

1.0.0-rc.15

7 years ago

1.0.0-rc.14

7 years ago

1.0.0-rc.12

7 years ago

1.0.0-rc.11

7 years ago

1.0.0-rc.10

7 years ago

1.0.0-rc.9

7 years ago

1.0.0-rc.8

7 years ago

1.0.0-rc.7

7 years ago

1.0.0-rc.6

7 years ago

1.0.0-rc.5

7 years ago

1.0.0-rc.3

7 years ago

1.0.0-rc.2

7 years ago

1.0.0-rc.1

7 years ago

0.19.7

7 years ago

0.19.6

7 years ago

0.19.5

7 years ago

0.19.4

7 years ago

0.19.3

7 years ago

0.19.2

7 years ago

0.19.1

7 years ago

0.19.0

7 years ago

0.18.2

7 years ago

0.18.1

7 years ago

0.18.0

7 years ago

0.17.1

7 years ago

0.17.0

7 years ago

0.16.1

7 years ago

0.16.0

7 years ago

0.15.0

7 years ago

0.13.0

7 years ago

0.12.3

7 years ago

0.12.2

7 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.0

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago