Note Before continuing, make sure you have installed:
To build Jestronaut, run the following command:
npm run buildThis builds the LuaRocks module and lit binary.
This will generate a jestronaut binary in the dist directory of this project. It expects to be added to path and will currently only run tests if you execute jestronaut in the root of your project
Most of Jestronaut's own tests are generated from the Jest documentation automatically.
You can run the test generation script with npm run generate-tests. All tests in tests/generated will be overwritten.
Use luarocks test in the root of this repo to execute the Jestronaut tests.
For coverage install the following LuaRocks modules:
luarocks install luacovluarocks install luacov-reporter-lcov
To publish Jestronaut to LuaRocks:
-
Build Jestronaut
npm run build
This will generate a
jestronaut-scm-0.rockspecfile in the root of this project. -
Copy
jestronaut-scm-0.rockspectorockspecs/jestronaut-<version>.rockspecand update the version number to the new version:For example for version
v0.5-2cp jestronaut-scm-0.rockspec rockspecs/jestronaut-0.5-2.rockspec
-
Modify the contents of the
rockspecs/jestronaut-<version>.rockspecfile to match the new version:package = "jestronaut" version = "0.5-2" -- the rest of the rockspec file remains unchanged
-
Commit theses changes to the repository:
git add . git commit -m "Update rockspec for version 0.5-2"
-
Tag the commit with the new version:
git tag v0.5-2
-
Push the commit and tag to GitHub:
git push origin main --tags
-
A GitHub Action will automatically build and publish the new version to LuaRocks.