asia v1.0.0-rc.10
asia

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.
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.
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 asiaAPI
If you want to use it in your tests, just do the following
Using ES Modules:
import expect from 'expect'
import test from 'asia';
test('my awesome test title', () => {
expect(typeof test).toBe('function');
});Using inside CommonJS environment (e.g. Node.js):
const assert = require('assert');
const test = require('asia');
test('some test in commonjs', () => {
assert.strictEqual(typeof test, 'function');
assert.strictEqual(typeof test.skip, 'function');
assert.strictEqual(typeof test.todo, 'function');
});Using type="module" in Browsers:
<script type="module">
import test from 'https://unpkg.com/asia?module';
test('foo bar', () => {
console.log('my browser tests');
});
</script>Using UMD bundle in the Browsers:
<script src="https://unpkg.com/asia/dist/index.js"></script>
<script type="text/javascript">
const test = window.test;
test('my awesome test', () => {});
</script>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).
This should be uses if you want to base something on top of the Asia API.
By default, the main export e.g. just 'asia' exposes a default export function,
which is the test() method.
Params
options{object} control testsconcurrencyor passserial: trueto run serially.
Returns
objectinstance with.test,.skip,.todoand.runmethods
Examples
import Asia from 'asia/dist/api/es';
// or in CommonJS (Node.js)
// const Asia = require('asia/dist/api/umd');
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 assert from 'assert';
import expect from 'expect';
import test from 'asia';
test('some awesome failing test', () => {
expect(1).toBe(2);
});
test('foo passing async test', async () => {
const res = await Promise.resolve(123);
assert.strictEqual(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 titlefn{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" testfn{function} do not pass test implementaton function
Examples
import assert from 'assert';
import test from 'asia';
test.todo('should be printed and okey');
test.todo('should throw, because does not expect test fn', () => {
assert.ok(true);
});.run
Run all tests, with optional settings options, merged with those
passed from the constructor.
Currently the supported options are serial and concurrency.
Params
settings{object} for example, passserial: trueto run the tests serially
Returns
Promise
Examples
import delay from 'delay';
import Asia from 'asia/dist/api/es';
const api = Asia({ serial: true });
api.test('first test', async () => {
await delay(1000);
console.log('one');
});
api.test('second test', () => {
console.log('two');
});
api.run({ concurrency: 10 });See Also
Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!
- @tunnckocore/create-project: Create and scaffold a new project, its GitHub repository and… more | homepage
- @tunnckocore/scripts: Universal and minimalist scripts & tasks runner. | homepage
- asia: Blazingly fast, magical and minimalist testing framework, for Today and… more | homepage
- charlike: Small, fast and streaming project scaffolder with support for hundreds… more | homepage
- docks: Extensible system for parsing and generating documentation. It just freaking… more | homepage
- git-commits-since: Get all commits since given period of time or by… more | homepage
- gitcommit: Lightweight and joyful
git commitreplacement. Conventional Commits compliant. | homepage - recommended-bump: Calculates recommended bump (next semver version) based on given array… more | homepage
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
- Any significant modifications must be subject to a pull request to get feedback from other contributors.
- Pull requests to get feedback are encouraged for any other trivial contributions, but are not required.
- 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.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago