balazs4 / alola Goto Github PK
View Code? Open in Web Editor NEWcurl -i | alola
License: MIT License
curl -i | alola
License: MIT License
Line 5 in d0a4a60
it is like ALOLA_REPORT=text
but shallowing curl
output.
maybe assertion-only reporter??
I do not care about the output but the assertions have to pass.
For example: health-check
https://github.com/balazs4/dotfiles/blob/ed1f0cff3003cd4597baa8fc7e9b50026b0df868/.zshrc#L408-L412
const rgb = require('barecolor')
module.exports = function(headline) {
const suite = [],
before = [],
after = [],
only = []
function self(name, fn) {
suite.push({ name: name, fn: fn })
}
self.only = function(name, fn) {
only.push({ name: name, fn: fn })
}
self.before = function(fn) { before.push(fn) }
self.after = function(fn) { after.push(fn) }
self.skip = function(fn) {}
// for testing Baretest
self.run = async function() {
const tests = only[0] ? only : suite
rgb.cyan(headline + ' ')
const failed = [];
for (const test of tests) {
try {
for (const fn of before) await fn()
await test.fn()
rgb.gray('• ')
} catch(e) {
for (const fn of after) await fn()
rgb.red('• ')
failed.push(()=>{
rgb.red(`\n\n! ${test.name} \n\n`)
prettyError(e)
});
continue
}
}
for (const fn of after) await fn()
if (failed.length === 0){
rgb.greenln(`✓ ${ tests.length }`)
console.info('\n')
return true
}
failed.forEach(fn => fn());
rgb.redln(`x ${ failed.length } of ${tests.length}`)
return false;
}
return self
}
function prettyError(e) {
const msg = e.stack
if (!msg) return rgb.yellow(e)
const i = msg.indexOf('\n')
rgb.yellowln(msg.slice(0, i))
rgb.gray(msg.slice(i))
console.info('\n')
}
pull_request to master
(workflow: pull-request.yml
)
npm ci
npm run test
release-it --dry-run
on master release-publish.yml
npm ci
npm run test
release-it
alola curl -H 'auth: xxxx' http://fake.api/create/<name> -XPOST -- \
'name should get string' \
'status should be 201'
/cc @chubin
alola 'headers.foobar should be undefined'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.