starlight icon indicating copy to clipboard operation
starlight copied to clipboard

Unit tests

Open playXE opened this issue 3 years ago • 8 comments

We do have a few unit tests already but they do not actually cover full engine

playXE avatar Jul 06 '21 10:07 playXE

Do you want unit tests in a separate mod or in comments?

Personally i tend to make them in comments (give every public fn a # example section) so they get deleted/changed with the function

andrieshiemstra avatar Jul 07 '21 07:07 andrieshiemstra

TBH I don't know. Some of the code might need much more tests that could fit in the doc comment i.e object methods that might have lots and lost of different behaviours

playXE avatar Jul 07 '21 07:07 playXE

FYI, working on a CONTRIBUTING.md to explain how we want tests and such

Question: if we add docs to public API and such: sagudev once made me a github action which publishes the rustdoc at github. maybe that would be nice for starlight also? see: https://github.com/HiRoFa/quickjs_es_runtime/blob/master/.github/workflows/rust.yml#L82

docs here

That way you can have the latest docs available online without publishing to crates.io

andrieshiemstra avatar Jul 07 '21 09:07 andrieshiemstra

Github action docs look nice! There's also docs/ directory in the root of the repository, shall we consider moving docs from there to Rust generated docs?

playXE avatar Jul 07 '21 10:07 playXE

shall we consider moving docs from there to Rust generated docs?

agreed!

andrieshiemstra avatar Jul 07 '21 11:07 andrieshiemstra

I think we could also make a public website using some static site generator, for example Docusaurus. And the docs under the root directory can be there. Also it could include a reference link to the cargo generated docs. At last, the website and the reference docs can all be deployed on GitHub pages using actions.

jameslahm avatar Jul 07 '21 17:07 jameslahm

@jameslahm there's already one: https://starlight-js.github.io/ but I haven't updated it for a while. I want to believe that soon I'll update it and write a few blog posts about internals,GC etc

playXE avatar Jul 07 '21 18:07 playXE

@playXE I see it before. I mean we could also consider some other more functional static site generator, including support search, table of content, auto translation to multiple language etc.

jameslahm avatar Jul 07 '21 18:07 jameslahm