(Show Table Of Contents)
(Hide Table Of Contents)

jDoctest

jDoctest is an useful test library for JavaScript that was inspired by Python‘s doctest module. It finds testable examples within your JavaScript files and checks if each example runs successfully.

No more you need separated test files or documentation files. You only need a single file which contains an executable source code, documentations, and testable examples.

The overview illustration

Browser Support

jDoctest supports these common browsers.

  • Google Chrome
  • Safari
  • Firefox
  • Opera

jDoctest doesn’t support Internet Explorer yet, because IE’s implementation of the eval function is different from other supported browsers.

Getting jDoctest

The repository for jDoctest is hosted at GitHub. You can checkout the source code with the following command.

$ git clone git://github.com/lunant/jdoctest.git jdoctest

Or you can download the compressed file.

Using jDoctest

Simple Tutorial

Here is a small sample code:

var ImageFile = function( url ) {
    /**class:ImageFile( url )

    A container for an image file.

        >>> var img = new ImageFile( "_static/jdoctest.png" );
        >>> img.url;
        '_static/jdoctest.png'
    */
    this.url = String( url );
};
ImageFile.prototype = {
    fetchData: function() {
        /**:ImageFile.prototype.fetchData()

        Requests the server for the image file. When the request is
        complete, it also sets the ``size`` and ``modified`` attributes
        of the object.

            >>> img.fetchData();
            >>> wait(function() { return img.data; });
            >>> img.size;
            30295
            >>> img.modified; //doctest: +SKIP
            Sat Sep 25 2010 19:57:47 GMT+0900 (KST)
        */
        $.get( this.url, function( data ) {
            this.data = data;
            this.size = data.length;
            this.modified = new Date(); // Not Implemented Yet
        });
    }
};

Now you’ll notice that the sample code we’ve just written contains example codes that describe the behaviours of ImageFile. We should run the examples to make sure that our implementation of ImageFile behaves as expected.

Before testing, we should save this code to a file named imagefile.js. To run the test, all we need to do is:

<script src="jquery.js"></script>
<script src="jdoctest.js"></script>
<script>
  jDoctest.testSource( "imagefile.js" );
</script>

By default, jDoctest reports using console.log, console.warn, and console.error. Watch the console output of the your browser! Is there no output? Don’t worry. It means the test ran successfully. jDoctest reports only failures by default. We can also see the progress of the test with the verbose option:

jDoctest.testSource( "imagefile.js", {
    verbose: true
});

jDoctest should report back:

Trying:
    var img = new ImageFile( "_static/jdoctest.png" );
Expecting nothing
---------------------------------------------
ok
---------------------------------------------
Trying:
    img.url;
Expecting:
    '_static/jdoctest.png'
---------------------------------------------
ok
---------------------------------------------
Trying:
    img.fetchData();
Expecting nothing
---------------------------------------------
ok
---------------------------------------------
Trying:
    wait(function() { return img.data; });
Expecting nothing
---------------------------------------------
ok
---------------------------------------------
Trying:
    img.size;
Expecting:
    30295
---------------------------------------------
ok
---------------------------------------------
4 passed.

Let’s make an example that fails. Our previous code already had a failing example but right now it is being ignored:

>>> img.modified; //doctest: +SKIP

We’ve used jDoctest.flags.SKIP() flag(//doctest: +SKIP) to ignore this example. We’ll talk more about the flags later on, but for now, we can remove this flag to get a failing example:

...
---------------------------------------------
Trying:
    img.modified;
Expecting:
    Sat Sep 25 2010 19:57:47 GMT+0900 (KST)
---------------------------------------------
File imagefile.js, line 23
Failed example:
    img.modified;
Expected:
    Sat Sep 25 2010 19:57:47 GMT+0900 (KST)
Got:
    Mon Sep 27 2010 00:40:19 GMT+0900 (KST)
---------------------------------------------
4 passed and 1 failed.
***Test Failed*** 1 failures.

jDoctest returns the file name and the line number for each failed example. We could use this information to debug more efficiently.

With QUnit

QUnit is a powerful test suite used by jQuery’s official projects.

jDoctest provides an extension for testing with QUnit. To use this extension, load jdoctest-qunit.js, setup QUnit template, and run jDoctest.testWithQUnit():

<html>
<head>
  <title>jDoctest with QUnit Test Suite</title>
  <link rel="stylesheet" type="text/css" href="qunit.css" />
  <script src="qunit.js"></script>
  <script src="jquery.js"></script>
  <script src="jdoctest.js"></script>
  <script src="jdoctest-qunit.js"></script>
</head>
<body>
  <h1 id="qunit-header">jDoctest with QUnit Test Suite</h1>
  <h2 id="qunit-banner"></h2>
  <div id="qunit-testrunner-toolbar"></div>
  <h2 id="qunit-userAgent"></h2>
  <ol id="qunit-tests"></ol>
  <script>
    jDoctest.testWithQUnit( "imagefile.js" );
  </script>
</body>
</html>

The result will look like:

The screenshot of jDoctest with QUnit test suite

Isn’t it much more beautiful and readable than default console outputs? We can now test using jDoctest-QUnit instead of vanilla jDoctest.

How It Works

jDoctest examines docstrings in your source code to find testable examples. You’ll need to write your tests within the source code.

What’s a Docstring?

A docstring is a multiline comment that starts with /**. The JavaScript comment below is a docstring. You can write the description or the detailed documentation of some function or class or anything in the docstring:

/**
It is a docstring.
*/

Optionally, a docstring could have a subject that is started with : and positioned behind /**. A subject could accept any string, but you should really use the function or the class’ signature:

/**:Number.prototype.limit( [ min, ] max )

If the number supplied is outside the range of ``min`` and ``max``, returns
``min`` or ``max``. Otherwise it returns the number.
*/

What’s a Testable Example?

A testable example looks like an interactive JavaScript session:

>>> String( 12345 );
'12345'
>>> for ( var i = 5; i >= 1; i-- ) {
...     print( i );
... }
54321

It should be written in a docstring:

/**:The subject of the docstring

Hello, You. I am a docstring. Here are some testable examples:

    >>> String( 12345 );
    '12345'
    >>> for ( var i = 5; i >= 1; i-- ) {
    ...     print( i );
    ... }
    54321
*/

A testable example has an executable code and an expected output. An output is a result of jDoctest.repr(). If the expected value is undefined, the output section is not needed. jDoctest will check if the expected output equals the actual output and report the result.

Using <BLANKLINE> Token

A testable example doesn’t contain a blank line, but what if your expected output contains one? If you want to include a blank line in the expected output, use <BLANKLINE> instead:

>>> print( "Hello,\n\nWorld!" );
Hello,
<BLANKLINE>
world!

Testing with Option Flags

Sometimes you want to alter the default behaviour of your tests. The testing option flags are suitable for this situation.

A single line comment that starts with //doctest: is a doctest directive. To add an option flag, add a doctest directive and list the flags you wish to use on the example code:

>>> 1 + 1; //doctest: +SKIP
... // This example will be skipped because of the ``SKIP`` flag.
>>> undefined.property; //doctest: +IGNORE_ERROR_MESSAGE
TypeError: Cannot read property 'property' of undefined
jDoctest.flags.ACCEPT_BLANKLINE(want, got)

Default flag.

>>> print( "a\n\nb" );
a
<BLANKLINE>
b
>>> print( "<BLANKLINE>" ); //doctest: -ACCEPT_BLANKLINE
<BLANKLINE>
jDoctest.flags.ACCEPT_TRUE_FOR_1(want, got)

Default flag.

>>> 1 === 1;
1
>>> 1 === 1;
true
>>> 1 === 2;
0
>>> 1 === 2;
false
jDoctest.flags.DONT_ACCEPT_BLANKLINE

A negetive flag for jDoctest.flags.ACCEPT_BLANKLINE().

>>> print( "<BLANKLINE>" ); //doctest: +DONT_ACCEPT_BLANKLINE
<BLANKLINE>
jDoctest.flags.DONT_ACCEPT_TRUE_FOR_1

A negetive flag for jDoctest.flags.ACCEPT_TRUE_FOR_1().

jDoctest.flags.ELLIPSIS(want, got)

When specified, an ellipsis marker(...) in the expected output can match any substring in the actual output.

>>> var want = "j...t";
>>> jDoctest.flags.ELLIPSIS( want, "jDoctest" );
true
>>> jDoctest.flags.ELLIPSIS( want, "jDoctest Team" );
false

Here is an example in the real world:

>>> "foobar"; //doctest: +ELLIPSIS
'foo...'
>>> "foobar"; //doctest: +ELLIPSIS
'foobar...'
>>> new TypeError( "foo" ); //doctest: +ELLIPSIS
TypeError: ...
jDoctest.flags.IGNORE_ERROR_MESSAGE(want, got)

When specified, the error message does not match. It is useful to cross-browser because some error message is different in various browsers.

>>> var want = "ReferenceError: TEST is not defined";
>>> var got = "ReferenceError: Can't find variable: TEST";
>>> var got2 = "TypeError: TEST is not defined";
>>> jDoctest.flags.IGNORE_ERROR_MESSAGE( want, got );
true
>>> jDoctest.flags.IGNORE_ERROR_MESSAGE( want, got2 );
false

Here is an example in the real world:

>>> LUNANT; //doctest: +IGNORE_ERROR_MESSAGE
ReferenceError: LUNANT is not defined
jDoctest.flags.NORMALIZE_WHITESPACE(want, got)

When specified, all whitespaces in the expected output and the actual output is treated as one space. It makes your example more simple.

>>> var want = "a  b  \t  c  \n  d";
>>> var got = "a b\n\n\n\t\t\t\n\nc                  d";
>>> var flag = jDoctest.flags.NORMALIZE_WHITESPACE;
>>> var flagResult = flag( want, got );
>>> flagResult.want;
'a b c d'
>>> flagResult.got;
'a b c d'
>>> flagResult.matched;
true

Here is an example in the real world:

>>> print( "a\nb\nc" ); //doctest: +NORMALIZE_WHITESPACE
a b c
>>> print( "function() {\n\treturn 132;\n}");
... //doctest: +NORMALIZE_WHITESPACE
function() {
  return 132;
}
class jDoctest.flags.SKIP(runner)

When specified, the example is skipped and not runned also. If your example never pass yet, use this flag and remove after implement.

>>> var result = {};
>>> var runner = new jDoctest.Runner( result, {
...     onComplete: function() { done = true; },
...     console: jDoctest._mockConsole
... });
>>> var doctest = new jDoctest([
...     new jDoctest.Example( "1 + 1; //doctest: +SKIP" )
... ]);
>>> var done = false;
>>> runner.run( doctest );
>>> wait(function() { return done; });
>>> result.tries.length;
0
>>> result.failures.length;
0

Here is an example in the real world:

>>> 1000000000000000 * 1000000000000000; //doctest: +SKIP
0
>>> memcache.get( "ork" ); //doctest: +SKIP
'wow!'

Helper Functions

You might want to try using wait and print. These global functions can help you to write more powerful examples.

jDoctest.Runner.prototype.context.print(output)

Prints a string. The output does not contain quotaions(') or escaped characters(\n).

>>> print( "a\nb\nc" );
a
b
c

The output is before of the returned value.

>>> for ( var i = 0; i < 20; i++ ) {
...     print( i + "." );
... }
... "done";
0.1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.
'done'
jDoctest.Runner.prototype.context.wait(delay)

delay is miliseconds or a function. If delay is miliseconds, the running process will wait for the miliseconds.

>>> var t = new Date();
>>> wait( 1000 );
>>> (new Date()).getTime() - t.getTime() >= 5;
true

If delay is a function, the running process will pause while the function returns false.

>>> var v = false;
>>> setTimeout(function() {
...     v = true;
... }, 10 ) && undefined;
>>> v;
false
>>> v;
false
>>> v;
false
>>> wait(function() { return v; });
>>> v;
true

Customization

jDoctest allows customization of the every symbol such as the docstring-prefix(/**), the docstring-suffix(*/), and the prompt-markers(>>>, ...).

Let’s assume you want to use /*DOCSTRING* as the docstring-prefix, *DOCSTRING*/ as the docstring-suffix, $ and > as the prompt-markers. Then follow this example:

jDoctest.testSource( "source-which-contains-some-docstrings.js", {
    symbols: {
        docPrefix: "/*DOCSTRING*",
        docSuffix: "*DOCSTRING*/",
        prompt: "$",
        continued: ">"
    }
});

If you want to customize more freely or make an extension for jDoctest, see the API chapter.

API

class jDoctest(examples[, name[, source[, fileName[, lineNo ] ] ])

A collaction of examples.

>>> new jDoctest([
...     new jDoctest.Example( "1;" ),
...     new jDoctest.Example( "1;" ),
...     new jDoctest.Example( "2;", "2" )
... ]);
<jDoctest (3 examples)>
>>> new jDoctest([ new jDoctest.Example( "1;" ) ]);
<jDoctest (1 example)>

It could have the identity. An identity is useful for debugging.

>>> new jDoctest([], "lykit", "", "lykit.js" );
<jDoctest lykit from lykit.js:1 (no examples)>
Arguments:
  • examples – the array of jDoctest.Example()
  • name – the name of the doctest
  • source – the source code of the doctest
  • fileName – the file name which contains the doctest
  • lineNo – the starting line number of the docstest
static OutputChecker

The default output checker. Every output checkers must have checkOutput method.

static checkOutput(want, got, flags)

Checks if got output matched to wanted output.

>>> var checker = jDoctest.OutputChecker;
>>> checker.checkOutput( "1", "1" );
true
>>> checker.checkOutput( "2", "1" );
false

If some matching flags in flags, that will be called. And if the result is a true, it returns true also. Otherwise it returns just false.

>>> checker.checkOutput( "a...f", "asdf", [
...     jDoctest.flags.ELLIPSIS
... ]);
true
static _mockConsole

It has methods named log, warn, error, and dir. All methods do not anything. jDoctest uses it instead of window.console in IE6 or Firefox without FireBug. Because window.console object is not available in there.

>>> jDoctest._mockConsole.log === jDoctest._mockConsole.warn;
true
>>> jDoctest._mockConsole.log === jDoctest._mockConsole.error;
true
>>> jDoctest._mockConsole.log === jDoctest._mockConsole.dir;
true
>>> !!/\{\s*\}/.exec( String( jDoctest._mockConsole.log ) );
true
>>> jDoctest.Runner.prototype.options.console !== undefined;
true
static _escapeRegExp(text)

Escapes for the regular expression.

>>> print( jDoctest._escapeRegExp( "/.*+?|" ) );
\/\.\*\+\?\|
Arguments:
  • text – a text
static _indent(indent, text)

Adds an indent to each lines.

>>> jDoctest._indent( "abc" );
'    abc'
>>> jDoctest._indent( " ", "abc" );
' abc'
>>> print( jDoctest._indent( " ", "abc\ndef" ) );
 abc
 def
Arguments:
  • indent – a indentation string
  • text – a text which is been indented
static _linearize(text)

Makes a multiline text to the linear text.

>>> /\n/.exec( jDoctest._linearize( "ab\ncd" ) );
null
Arguments:
  • text – a text
static _outindent(indent, text)

Removes an indent from each lines.

Arguments:
  • indent – a removing indentation string
  • text – a text which is been outdented
static _unlinearize(text)

The inverse function of jDoctest._linearize().

>>> /\n/.exec( jDoctest._unlinearize(
...     jDoctest._linearize( "ab\ncd" )
... ) ) !== null;
true
Arguments:
  • text – a text
static getMaterials(options)

Returns a jDoctest.Parser() and a jDoctest.Runner() from options.

>>> var pr = jDoctest.getMaterials({
...     verbose: true,
...     symbols: {
...         prompt: "$",
...         continued: ">"
...     }
... });
>>> var parser = pr.parser;
>>> var runner = pr.runner;
>>> parser.symbols.prompt;
'$'
>>> parser.symbols.continued;
'>'
>>> runner.options.verbose;
true
Arguments:
static repr(val)

Represents a value.

>>> jDoctest.repr( undefined );
>>> jDoctest.repr( [] );
'[]'
>>> jDoctest.repr( [1, 2, 3] );
'[1, 2, 3]'
>>> jDoctest.repr( "Hello, world!" );
'\'Hello, world!\''
>>> jDoctest.repr( "It's my world!" );
'\'It\\\'s my world!\''
>>> jDoctest.repr( ["It's my world!"] );
'[\'It\\\'s my world!\']'
>>> jDoctest.repr( jDoctest.flags.SKIP );
'<jDoctest.flags.SKIP>'
>>> print( jDoctest.repr( "\n\n\n" ) );
'\n\n\n'
Arguments:
  • val – the value
static testFile(fileName[, options])

Load a file and tests its content as a docstring:

jDoctest.testFile( "a-docstring.txt" );

The content of the file is a docstring. jDoctest.Parser() finds only examples(not docstrings).

Arguments:
static testSource(fileName[, options])

Tests a JavaScript source file:

jDoctest.testSource( "source-which-contains-docstrings.js" );

The source file should contain some docstrings. A docstring is a multiline-comment which starts with /** or a specified doc-prefix.

Arguments:
class jDoctest.Example(source, want[, lineNo])

A JavaScript example.

>>> var exam = new jDoctest.Example( "1 + 1;", "2" );
>>> exam;
<jDoctest.Example>
>>> exam.source;
'1 + 1;'
>>> exam.want;
'2'
>>> exam.flags;
[]
>>> var src = "throw new Error(); //doctest: +SKIP";
>>> var flagedExam = new jDoctest.Example( src, undefined );
>>> flagedExam.flags;
[<jDoctest.flags.SKIP>]
_findFlags(source)

Returns a flag list from the source code.

>>> var src = "1; //doctest: +SKIP +ELLIPSIS";
>>> var exam = jDoctest.Example.prototype;
>>> var flags = exam._findFlags( src ).positive;
>>> $.inArray( jDoctest.flags.SKIP, flags ) >= 0;
true
>>> $.inArray( jDoctest.flags.ELLIPSIS, flags ) >= 0;
true
>>> $.inArray( jDoctest.flags.ACCEPT_BLANKLINE, flags ) < 0;
true
class jDoctest.Parser(symbols)

A parser to catch docstrings and interactive examples.

You could specify doc-prefix or doc-suffix or prompt symbols using symbols argument:

>>> var myParser = new jDoctest.Parser({
...     docPrefix: "/*+",
...     docSuffix: "+*" + "/"
... });

myParser has differant symbols. It executes like:

>>> var src = "this is not a docstring.\n" +
...     "/*+ this is a docstring +*" + "/\n" +
...     "/** this is not a docstring *" + "/\n" +
...     "/** this is not a docstring also *" + "/";
>>> var doctests = myParser.getDoctests( src );
>>> doctests.length;
1
Arguments:
  • symbols – the parsing symbols
getDoctests(source)

Parses a JavaScript source and returns docstring list.

>>> var parser = new jDoctest.Parser({
...     docPrefix: "/*+",
...     docSuffix: "+*" + "/"
... });
>>> var doctests = parser.getDoctests(
...     "/*+ Hello, world! +*" + "/"
... );
>>> doctests.length;
1
>>> doctests[ 0 ];
<jDoctest (no examples)>
getExamples(docString)

Returns :class:`jDoctest.Example`s from a docstring.

>>> var src = "asdfasdfsdf\n" +
... "sadfasdf\n" +
... "\n" +
... "  $ asfsdf;\n" +
... "  > 12312;\n" +
... "  > function() {\n" +
... "  >   return '123123';\n" +
... "  > }\n" +
... "  123123\n" +
... "  $ gggggggg;\n" +
... "  213123\n";
>>> var parser = new jDoctest.Parser({
...     prompt: "$",
...     continued: ">"
... });
>>> var examples = parser.getExamples( src );
>>> examples.length;
2
>>> print( examples[ 0 ].source );
asfsdf;
12312;
function() {
  return '123123';
}
>>> examples[ 0 ].want;
'123123'
>>> examples[ 1 ].source;
'gggggggg;'
>>> examples[ 1 ].want;
'213123'
class jDoctest.Runner(result[, options])

The runner is used to run a doctest.

>>> var result = {}, done = false;
>>> var doctest = new jDoctest([
...     new jDoctest.Example( "1;", "1" ),
...     new jDoctest.Example( "0; //doctest: +SKIP", "1" ),
...     new jDoctest.Example( "0;", "1" ),
... ]);
>>> var runner = new jDoctest.Runner( result, {
...     onComplete: function() { done = true; },
...     console: jDoctest._mockConsole
... });

It will update result object which is given. result is extended to have arrays named tries, successes, failures, and skips.

>>> result.tries.length;
0
>>> runner.run( doctest );

When all test done result‘s arrays is also updated.

>>> wait(function() { return done; });
>>> result.tries.length;
2
>>> result.successes.length;
1
>>> result.failures.length;
1
adjustFlags(flags, negativeFlags)

Returns a flag list that is adjusted with the runner’s flags.

>>> var runner = new jDoctest.Runner( {}, {
...     flags: [jDoctest.flags.SKIP, jDoctest.flags.ELLIPSIS]
... });
>>> runner.adjustFlags([
...     jDoctest.flags.IGNORE_ERROR_MESSAGE
... ], [
...     jDoctest.flags.SKIP
... ]);
[<jDoctest.flags.IGNORE_ERROR_MESSAGE>, <jDoctest.flags.ELLIPSIS>]
checkExample(exam, got)

Checks if the got value equals to the expected value using the own OutputChecker() instance. The example will be kept in the result object.

>>> var runner = new jDoctest.Runner();
>>> var mockExample = { want: "Hello", flags: [] };
>>> runner.checkExample( mockExample, "Hello" );
true
>>> runner.result.successes.length;
1
>>> runner.checkExample( mockExample, "World" );
false
>>> runner.result.failures.length;
1
eval(source)

Evaluates the given source code. And returns the returned value or exception object.

>>> var runner = new jDoctest.Runner();
>>> runner.eval( "'abc' + 'def'" );
'abcdef'
>>> runner.eval( "throw new Error( 'TEST' );" );
Error: TEST
getCurrentDoctest()

Returns the last processed jDoctest() object.

getOutput(source)

Returns the representation of the returned value and the output(with jDoctest.Runner.prototype.context.print()) from the given source code.

>>> var runner = new jDoctest.Runner();
>>> runner.getOutput( "print( 'abc' ); 'def';" );
'abc\n\'def\''
progress()

Processes the top task and call this method again if the task list is not empty.

A task could be an instance of jDoctest() or jDoctest.Example(). If the task is an instance of jDoctest(), this method just updates the current doctest object. But the task is an instance of jDoctest.Example(), it calls jDoctest.Runner.prototype.reportStart() and tests the example.

>>> var runner = new jDoctest.Runner( undefined, {
...     onComplete: function() {
...         print( "ALL TASKS HAVE PROCESSED" );
...     }
... });
>>> var doctest = new jDoctest([
...     new jDoctest.Example( "1;", "1" )
... ]);
>>> runner.register( doctest );
>>> runner.getCurrentDoctest();
null
>>> runner.progress();
ALL TASKS HAVE PROCESSED
>>> runner.getCurrentDoctest() instanceof jDoctest;
true
Arguments:
  • justOneStep – if set it to true, this method doesn’t go to next step.
register(doctest)

Registers the given doctest to the task list.

reportFailure(exam, got)

Reports when the example is failed.

reportFinally()

Reports when the doctest done.

reportStart(exam)

Reports before the example runs.

reportSuccess(exam, got)

Reports when the example is succeeded.

run([doctest])

This method registers a doctest to its task list first. And runs tasks:

var runner = new jDoctest.Runner();
var doctest = new jDoctest();
runner.run( doctest );

Or:

var runner = new jDoctest.Runner();
var doctest = new jDoctest();
runner.register( doctest );
runner.run();
runExample(exam)

Runs the given example and reports a result. If the example throws a StopRunning exception, it makes the running to stop.

runFinally()

It will be called after all examples ran.

start()

Starts the running process.

stop()

Stops the running process.

static extend(prototype)

Makes a new runner class which extends jDoctest.Runner(). The new runner’s constructor needs an other jDoctest.Runner() instance. It shares some attributes with the other runner.

>>> var MyRunner = jDoctest.Runner.extend({
...     reportStart: function() {
...         this.result.foo = "bar";
...         print( "MY RUNNER!" );
...     }
... });
>>> var result = {};
>>> var runner = new jDoctest.Runner( result );
>>> var myRunner = new MyRunner( runner );
>>> myRunner instanceof MyRunner;
true
>>> myRunner instanceof jDoctest.Runner;
true
>>> myRunner.reportStart();
MY RUNNER!
>>> myRunner.result.foo;
'bar'
>>> runner.result.foo;
'bar'
class jDoctest.errors.StopRunning()

This exception will stop the jDoctest running process.

jDoctest.Runner.prototype.options.flags

The default flags.

>>> (new jDoctest.Runner( {} )).options.flags;
[<jDoctest.flags.ACCEPT_TRUE_FOR_1>, <jDoctest.flags.ACCEPT_BLANKLINE>]

License

jDoctest is licensed with MIT + GPL2, so feel free to use and manipulate as long as you respect these licenses. See MIT-LICENSE.txt and GPL-LICENSE.txt for the details.

Author

jDoctest was written by Heungsub Lee and is being maintained by Lunant‘s jDoctest team.

More Information

  • You can report any issues at the issues page.
  • If you have any questions, join the mailing list by sending a mail to jdoctest@librelist.com.
  • doctest.js is another JavaScript implementation of doctest from a different angle.
Fork me on GitHub