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

Update README.md and docs #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roact is deprecated.

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.