testdouble / docunit Goto Github PK
View Code? Open in Web Editor NEWMakes sure the code examples in your docs actually work
Makes sure the code examples in your docs actually work
like any test tool, a lot of configuration will be necessary to be usable. my idea here is to have a global config passed to docunit(globs, [config])
with some properties like:
cb
with ('example|file|all', text|path|??), respectively, each invoked outside the vm/context the tests are runcb
for each file|example|all invoked inside the vm/context the tests are runIf any config options are static and differ between files, some CSON front matter could be used on a file-by-file basis, a la:
language: 'ruby'
it's too hard to tell if your file just got missed.
for people who want to include this in their test reports
Read in a single markdown file, find the code example, run it:
a CLI command called docunit that takes as arguments paths/globs
right now any code blocks docunit executes will see their require()
calls (if they have any) executed from the docunit run-in-.....js file. should be relative to wherever the markdown file lives.
an adapter API to register (on a per-process basis, via docunit.register()
) adapter functions for things like coffee-script & babel to be able to run those languages.
The config for which lang we're looking at will be with three levels of locality:
docunit('paths', config)
as language
language
key", like "
coffee", allowing users to mix and match within a fileregister
should receive an object with properties:
expected
and actual
strings. docunit will replace the line with lines to save off the values and include an assertyright now throwing an error in a code block will break the test as well
throw new Error("LOL")
A config option should probably be available to squash these as some docs obviously want to throw errors
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.