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

update Programmatic API documentation #3138

Closed
boneskull opened this issue Dec 9, 2017 · 9 comments · Fixed by #3323
Closed

update Programmatic API documentation #3138

boneskull opened this issue Dec 9, 2017 · 9 comments · Fixed by #3323
Labels
area: documentation anything involving docs or mochajs.org status: accepting prs Mocha can use your help with this one!

Comments

@boneskull
Copy link
Contributor

From @boneskull on July 12, 2015 4:13

from #1298

There is very little information that explains how to use the programmatic interface. All that is really mentioned is this wiki page that provides an example. It would be nice to see explicitly what is available like this (for example).

Copied from original issue: mochajs/old-mochajs-site#6

@boneskull
Copy link
Contributor Author

From @cloakedninjas on October 16, 2015 10:59

👍

@boneskull boneskull added area: documentation anything involving docs or mochajs.org status: accepting prs Mocha can use your help with this one! good first issue new contributors should look here! and removed good first issue new contributors should look here! labels Dec 9, 2017
@dfberry
Copy link
Contributor

dfberry commented Dec 24, 2017

I've read #3140, the only API doc page, and the CLI versus API perspective. What are you hoping for in new/more docs for the API?

@v-geberr
Copy link

@boneskull Any insight here?

@boneskull
Copy link
Contributor Author

Ideally:

  • We would generate some documentation from the docstrings in the codebase with documentation or a like tool
  • Update those docstrings if necessary
  • Provide tutorials for
    • Writing a custom reporter
    • Writing a custom interface
    • Running Mocha programmatically through its API (with a pragmatic use case)
  • All of this should live in docs/ somewhere and linked to from the main page.
    For now, since mochajs.org only has a single page, this necessarily may need some decisions around styling, but a logo and default theme would work with the API docs. The tutorial can just pull in the styles from the main page, I guess.
  • The wiki page should probably be removed and links to the new content put in as its replacement

(Are you @dfberry or @v-geberr? I was going to give credit in the CHANGELOG with v5.0.0)

@boneskull
Copy link
Contributor Author

(The tutorials can be a separate effort, but at minimum we will need API docs generated)

@dfberry
Copy link
Contributor

dfberry commented Jan 20, 2018

Hi @boneskull,
@dfberry is the correct account. The @v-geberr is my work account -- sorry about that confusion -- I'll be more consistent moving forward.

Thank you for the direction. Can you assign this to me? Or how do I do it?

@dfberry
Copy link
Contributor

dfberry commented Feb 4, 2018

@boneskull I have a rough draft of the API doc generated from documentationjs here. I pulled everything that was labeled public or that I thought was public. There relationships are only there for the reporters not the project as a whole. Can you look it over and give feedback?

@OSP123
Copy link

OSP123 commented Mar 8, 2018

@dfberry Would love to see that API doc, but getting 404. Any way that can be made public?

Munter pushed a commit that referenced this issue Apr 12, 2018
Fixes #3138
Replaces and closes #3239

basically working

Suite and utils work

Runner and Suite datatypes work

Hook extends Runnable - at least link in description

hook is child of mocha and has error

first solid pass

Remove attempted module link from Hook to Runnable because of documentationjs/documentation#820

Switch API documenation to html output, link to them, include in site build

Update TOC

Bring lock file in sync with package.json

Linting

Update package-lock.json
Munter pushed a commit that referenced this issue Apr 12, 2018
Fixes #3138
Replaces and closes #3239

basically working

Suite and utils work

Runner and Suite datatypes work

Hook extends Runnable - at least link in description

hook is child of mocha and has error

first solid pass

Remove attempted module link from Hook to Runnable because of documentationjs/documentation#820

Switch API documenation to html output, link to them, include in site build

Update TOC

Bring lock file in sync with package.json

Linting

Update package-lock.json
boneskull pushed a commit that referenced this issue Apr 12, 2018
Fixes #3138
Replaces and closes #3239

basically working

Suite and utils work

Runner and Suite datatypes work

Hook extends Runnable - at least link in description

hook is child of mocha and has error

first solid pass

Remove attempted module link from Hook to Runnable because of documentationjs/documentation#820

Switch API documenation to html output, link to them, include in site build

Update TOC

Bring lock file in sync with package.json

Linting

Update package-lock.json
@k3n
Copy link

k3n commented Aug 14, 2018

Also wishing there was more documentation.

My use case: I'd like to take a group of directories, and add each directory as a Suite (obviously containing the tests inside).

I can add each of the files independently using Mocha#addFile, and I can create a Suite, but Suite only provides a Suite#addTest which expects a Test object created from a function. I don't know how to transform a test file into a function that it expects. I'm pretty sure I can figure it out in a few more hours, but it sure would be nice to not have to deconstruct the source to figure that out (and to be sure I do it correctly).

sgilroy pushed a commit to TwineHealth/mocha that referenced this issue Feb 27, 2019
Fixes mochajs#3138
Replaces and closes mochajs#3239

basically working

Suite and utils work

Runner and Suite datatypes work

Hook extends Runnable - at least link in description

hook is child of mocha and has error

first solid pass

Remove attempted module link from Hook to Runnable because of documentationjs/documentation#820

Switch API documenation to html output, link to them, include in site build

Update TOC

Bring lock file in sync with package.json

Linting

Update package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation anything involving docs or mochajs.org status: accepting prs Mocha can use your help with this one!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants