Releases: Roblox/testez
v0.4.2
v0.4.1
afterEach
blocks now run their code afterit
blocks fail or error
v0.4.0
- Added
expect.extend
which allows projects to register their own, opinionated expectations that integrates intoexpect
. (#142)- Modeled after jest's implementation.
- Matchers are functions that should return an object with with two keys, boolean
pass
and a stringmessage
- Like
context
, matchers introduced viaexpect.extend
will be present on all nodes below the node that introduces the matchers. - Limitations:
expect.extend
cannot be called from withindescribe
blocks- Custom matcher names cannot overwrite pre-existing matchers, including default matchers and matchers introduces from previous
expect.extend
calls.
- Change the way errors are collected to call tostring on them before further processing.
- Luau allows non-string errors, but not concatenating non-strings or passing non-strings to
debug.traceback
as a message, so TestRunner needs to do that step. This is a temporary fix as the better solution would be to retain the error in object form for as long as possible to give the reporter more to work with. - This also makes a slight change to what's in the traceback to eliminate the unnecessary line mentioning the error collection function.
- Luau allows non-string errors, but not concatenating non-strings or passing non-strings to
- Fix debugging of tests in Studio
v0.3.3
Fixed a bug where passing lifecycle hooks would show up as [?] in the quiet output.
v0.3.2
- Some cleanup of the TestEZ CLI internals
- Added the ability to pass in a string to expect.to.throw. This will search the error message for a matching substring and report a failure if it's not there.
v0.3.1
This release includes changes to the internals of lifecycle hooks and the release of the context API.
A context object is now passed along to all lifecycle hooks and to it
blocks. This is a write-one store for any information or helper functions you need to pass between these parts of tests.
Changes since 0.3.0
- Further simplify
beforeAll
handling.beforeAll
now runs on entering the block, rather than on the firstit
encountered after entering the block. The major difference for the moment is that abeforeAll
will now run even if there are noit
blocks under it, which is now consistent with howafterAll
worked.beforeAll
andafterAll
now report errors by creating a dummy node in the results to contain the error. Previously, errors inafterAll
were not reported.- A failure in a
beforeAll
block will now halt all further test execution within its enclosingdescribe
block except for any remainingbeforeAll
blocks and anyafterAll
blocks. MultiplebeforeAll
orafterAll
blocks within onedescribe
block should not count on running in any specific order.afterAll
blocks should account for the possibility of a partially setup state when cleaning up.
- Add a context object visible from lifecycle hooks and
it
blocks. This is a write-once store for whatever you need to communicate between hooks and tests. It can be ignored until you need it.- In particular, you can usually just use upvalues to comminucate between hooks and tests, but that won't work if your hooks are in a separate file (e.g.
init.spec.lua
). - Also, this provides a cleaner alternative to extraEnvironment for passing along helper functions to large numbers of tests as the context can be scoped to particular directories as needed.
- In particular, you can usually just use upvalues to comminucate between hooks and tests, but that won't work if your hooks are in a separate file (e.g.
v0.3.0
This release includes foundational changes to TestEZ's test planning implementation, as well as a slew of bugfixes and consistency improvements across the board.
We have additionally removed some unused, deprecated API members.
Changes since 0.2.0
- Remove the
try
node type.- Remove the
step
alias forit
since that's meant for use withtry
.
- Remove the
- Remove the
include
global function. - Remove
HACK_NO_XPCALL
. With recent changes to the definition of xpcall, this is no longer necessary. Since people are still using it, it will now print out a warning asking them to delete that call instead. - Major changes to the internals of test planning.
- The major visible change is that
describe
andit
blocks with duplicate descriptions will now not overwrite the earlier copies of those nodes. - Duplicate
it
nodes within onedescribe
will raise an error. - TestPlanBuilder was removed from the API.
- The major visible change is that
- Fixed a bug with how
beforeAll
andafterAll
handled nested nodes. - Implemented alphabetical sorting of the entire test tree which provides deterministic tests execution order regardless of platform, architecture or tool used to load tests.
- Fixed interactions with roblox-cli in TestEZ CLI.
v0.2.0
This change is the first release that includes the TestEZ CLI, which is a new way to run TestEZ without needing to install some of its dependencies. It also includes a new lifecycle feature.
To install the CLI, download the correct attached zip here or use a tool like Foreman:
[tools]
testez = { source = "Roblox/testez", version = "0.2.0" }
Changes since 0.1.1
- Added support for
init.spec.lua
. Code in this file is treated as belonging to the directory's node in the test tree. This allows for lifecycle hooks to be attached to all files in a directory. - Added TestEZ CLI, a Rust tool that bundles TestEZ and Lemur, and can run tests via Lemur or Roblox-CLI (#61)