tests | R Documentation |
Adds tests to a project, currently supports mocha and peeky, see details for more.
include_tests_mocha(esm = TRUE) include_tests_peeky() add_test_file(name) run_tests(open = FALSE)
esm |
Whether to install |
name |
Name of the test file to add, without extension. |
open |
Only valid for "peeky," this will open a development
UI if |
include_tests_mocha
uses mocha and
mocha-webpack and
creates a directory called testjs
where tests should be placed.
The function run_tests()
will then uses mocha on all the files in
the testjs
directory. All tests should end with .test.js
.
include_tests_peeky
uses peeky
it's very similar to mocha but also comes with a development UI
that can be accessed when running tests by setting open
to
TRUE
.
Requiring esm
(esm = TRUE
) is recommended as it will allow using the latest
ESM, e.g.: import
in tests.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.