Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract documentation samples from test cases #181

Open
ArnaudBuchholz opened this issue Sep 21, 2017 · 0 comments
Open

Extract documentation samples from test cases #181

ArnaudBuchholz opened this issue Sep 21, 2017 · 0 comments

Comments

@ArnaudBuchholz
Copy link
Owner

ArnaudBuchholz commented Sep 21, 2017

We need to create a link between an API and the associated test cases.
Caption should be possible through a special tag

Proposal:

  • In the source file, @gpf.sample ID [caption]
/**
 * @gpf:sameas _gpfWebTagCreateFunction
 * @since 0.2.1
 * @gpf:sample DIV
 */
gpf.web.createTagFunction = _gpfWebTagCreateFunction;
  • In the associated test file: function () {
        it("supports tree building (parameters)", function () {
            // @gpf:sample DIV
            var div = gpf.web.createTagFunction("div"),
                span = gpf.web.createTagFunction("span"),
                tree = div({className: "test1"}, "Hello ", span({className: "test2"}, "World!"));
            assert(tree.toString() === "<div class=\"test1\">Hello <span class=\"test2\">World!</span></div>");
        });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant