Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoprank committed Mar 5, 2024
1 parent 26a5247 commit 18b8ec9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@

<div>&nbsp;</div>

TestEZ can run within Roblox itself, as well as inside [Lemur](https://github.com/LPGhatguy/Lemur) for testing on CI systems.
TestEZ can run within Roblox itself.

We use TestEZ at Roblox for testing our apps, in-game core scripts, built-in Roblox Studio plugins, as well as libraries like [Roact](https://github.com/Roblox/roact) and [Rodux](https://github.com/Roblox/rodux).

It provides an API that can run all of your tests with a single method call as well as a more granular API that exposes each step of the pipeline.

TestEZ can also run inside [Lemur](https://github.com/LPGhatguy/Lemur) for testing on CI systems however Lemur is no longer supported so this flow is not recommended.

## Inspiration and Prior Work
The `describe` and `it` syntax in TestEZ is based on the [Behavior-Driven Development](https://en.wikipedia.org/wiki/Behavior-driven_development) methodology, notably as implemented in RSpec (Ruby), busted (Lua), Mocha (JavaScript), and Ginkgo (Go).

The `expect` syntax is based on Chai, a JavaScript assertion library commonly used with Mocha. Similar expectation systems are also used in RSpec and Ginkgo, with slightly different syntax.

[Jest](https://github.com/Roblox/jest-roblox) is a very similar testing framework based on [https://jestjs.io/](https://jestjs.io/) however it's currently not available for use by Roblox developers (we're working on it) so TestEZ is still the recommended testing framework.

## Contributing
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for information.

Expand Down
10 changes: 6 additions & 4 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
### Method 1: Rojo (Roblox)
* Copy the `src` directory into your codebase
* Rename the folder to `TestEZ`
* Use [Rojo](https://github.com/LPGhatguy/rojo) to sync the files into a place
* Use [Rojo](https://github.com/rojo-rbx/rojo) to sync the files into a place

### Method 2: Lemur (CI Systems)
You can use [Lemur](https://github.com/LPGhatguy/Lemur) paired together with a regular Lua 5.1 interpreter to run tests written with TestEZ.
### Method 2: Wally (Roblox)
* TestEZ is available with [Wally](https://wally.run/package/roblox/testez)
* [Rojo](https://github.com/rojo-rbx/rojo) is prerequisite for [wally](https://wally.run/install)

This is the best approach when testing Roblox Lua libraries using existing continuous integration systems like Travis-CI. We use this technique to run tests for [Rodux](https://github.com/Roblox/Rodux) and other libraries.
### Method 3: Lemur (CI Systems)
You can use [Lemur](https://github.com/LPGhatguy/Lemur) paired together with a regular Lua 5.1 interpreter to run tests written with TestEZ. Note that Lemur is no longer supported.
13 changes: 11 additions & 2 deletions docs/getting-started/running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ local TestEZ = require(<path to TestEZ>)
TestEZ.TestBootstrap:run({ MY_TESTS })
```

The method also returns information about the test run that can be used to take further action!
This will run all files post-fixed with *.spec.lua (in Rojo) that are children of `MY_TESTS`

The internals of TestEZ are being reworked, so accessing other APIs at this time isn't recommended.
For example, you might have

- Shared (mapped to ReplicatedStorage)
- AnimalModule
- cat.lua
- cat.spec.lua
- dog.lua
- dog.spec.lua

then setting `MY_TESTS = game.ReplicatedStorage.Shared.AnimalModule` would run the tests in cat.spec.lua and dog.spec.lua
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TestEZ is a BDD-style testing framework for Roblox Lua.

We use TestEZ at Roblox for testing our apps, in-game core scripts, built-in Roblox Studio plugins, as well as libraries like [Roact](https://github.com/Roblox/roact) and [Rodux](https://github.com/Roblox/rodux).
We use TestEZ at Roblox for testing our apps, in-game core scripts, built-in Roblox Studio plugins.

It provides an API that can run all of your tests with a single method call as well as a more granular API that exposes each step of the pipeline.

0 comments on commit 18b8ec9

Please sign in to comment.