https://github.com/simbathesailor/mocha-minimal-async
This project is asynchronous implementation of https://github.com/ciju/mini-mocha .(minimal -mocha) :hear_no_evil:
https://github.com/simbathesailor/mocha-minimal-async
Last synced: 3 months ago
JSON representation
This project is asynchronous implementation of https://github.com/ciju/mini-mocha .(minimal -mocha) :hear_no_evil:
- Host: GitHub
- URL: https://github.com/simbathesailor/mocha-minimal-async
- Owner: simbathesailor
- License: mit
- Created: 2017-03-26T09:24:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-27T17:30:04.000Z (about 8 years ago)
- Last Synced: 2025-01-05T17:09:51.031Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mini-mocha
A minimal asynchronous mocha like DSL.
This project is based on the synchronous implemention of minimal mocha testing framework at https://github.com/ciju/mini-mocha.
This project provide asynchronous APi for testing asynchronous unit test and outputting the results in 'output.txt' file in tha base folder in inorder fashion.It means the sequences of running the test cases and output will be same irrespective of how many asynchronous tests are there in between.```
test(,,);
: title of the test.
: Where user will do asunchronous tasks;
: callbcak for asyncCallFunctiontestSuite('Async Set 1 partial', () => {
test('async test 1', (done) => {
setTimeout(() => { //do asynchronous tasks
done(null, ![]);
}, 7000);
}, (...params) => {
var [successLogger, failureLogger, desc, descArray, index, loggerObject, printToFile, err, value] = params;
if (err) {
descArray[index] = loggerObject(failureLogger, desc, err.message);
return;
}
try {
assert.equal(value, false);descArray[index] = loggerObject(successLogger, desc);
} catch (e) {
descArray[index] = loggerObject(failureLogger, desc, e.message);
}
printToFile(descArray);
});});
```