@mintlab/kitchen-sink
Everything but: miscellaneous Mintlab utility functions.
Installation
$ npm install @mintlab/kitchen-sink
Usage
There is no monolithic main
file, require
or import
the modules that you need directly.
Example
const dictionary = require('@mintlab/kitchen-sink/dictionary');
Development
Docker
Start an interactive ash
shell for development:
$ docker-compose exec sink sh
If you edit .*rc
files in ./root
, you must manually copy
them to your current working directory in the container.
The package*.json
files are symlinked because they can be
mutated both on the host and in the container.
Publication
The package is published with
semantic-release-gitlab
on every merge to the master branch. Mind your commit messages.
Files in ./source
are copied to the root and removed after publication.
See the prepublishOnly
and postpublish
lifecycle scripts in package.json
.
Infrastructure
The modules in this package export Node.js modules and
work natively on the server. There is no transpilation and
distribution build included, to consume them in the browser
use your bundler of choice.
See also
Unit testing
Unit tests use
tape, a
TAP
producing test harness for node.
Async
No special libraries or plugins are needed for async tests:
- make the test callback
async
plan
the number of assertionsawait
the async value- proceed as with any other test
Example
test('The async answer', async assert => {
assert.plan(1);
const answer = await new Promise(resolve => {
setTimeout(() => resolve(42), 1000);
});
assert.equal(answer, 42, 'is always 42');
assert.end();
});
License
Copyright 2017 Mintlab B.V.
Licensed under the EUPL, Version 1.1 or – as soon they will be approved by the European Commission -
subsequent versions of the EUPL (the "Licence").
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at:
https://joinup.ec.europa.eu/software/page/eupl