- fix warning when multiple configuration are found (#8)
- fix error message when no tests are found (#7)
- ✨ Added a fallback to use
loadstringinstead ofloadmodulein lower privileged contexts (#392) - ✨ Added
redactStackTraceoption to improve stability to snapshots that contain stacktraces (#401) - 🛠️ Add more helpful error message when requiring
JestGlobalsoutside test environment (#405) - 🛠️ Error when trying to load a nonexistant
PrettyFormatplugin (#407) - 🛠️ Stabilize
RobloxInstanceserialization tests (#408)
- 🐛 Fix a type analysis error in
JestRuntime(#403)
- ✨ Support spying on Lua globals with
spyOn(#397) - 🐛 Expose safe APIs to read and write Roblox Instance properties in the
RobloxInstancelibrary forPrettyFormatto serialize Instances safely (#398) - 🛠️ Clean up package manifests, READMEs and documentation (#400 #402)
- 🐛 Fix mismatched test paths between reporter and runner (#396)
- ✨ Mock task.wait (#388)
- ✨ Resolve DOM paths to FS paths if possible in
JestRunner(#373)
- 🛠️ Re-release of 3.6.0 with widened promise dependency that includes older versions for maximum flexibility (#378)
- 🛠️ Upgrade promise dependency, but keep constraint wide so that all future 3.x versions are valid (#374)
- 🛠️ Fix matching logic for RegExp objects (#371)
- ✨ Added
task.failingsupport to easily mark tests that are suppose to fail (#370) - ✨ Added
task.cancelsupport to cancel timeouts started withtask.delays(#368)
- 🛠️ Fix an issue that was hiding error messages in test failure output (#360)
- ✨ Allow toThrow to match on regular expressions if the expected error matches the RegExp type (has a test and exec function) (#357)
- ✨ Add nil asymmetric matcher
expect.nothing()to match againstniland undefined values
- 🛠️ Relax requirement to report a value in a JestBenchmark profiler section
- 🛠️ Catch error in JestBenchmark.HeartbeatReporter when a heartbeat occurs outside of a reporting section
- 🛠️ Export
benchmarkthroughJestBenchmark.benchmarkinstead ofJestBenchmark.benchmark.benchmark
- ✨ Added the JestBenchmark module
- 🛠️ Upgrade to v28.0.0 (#266)
- ✨
pretty-format: AddedprintInstanceDefaultsformatting option that toggles whether unmodified Instance properties are printed (#341) - ✨ Added
snapshotFormatconfiguration option (#341) - ✨ Added support for a configurable engine frame time for fake timers (#343)
- 🐛 Fix error when obsolete snapshots and no file system access (#334)
- 🐛 Fix separateMessageFromStack not working when there is no stack available (#332)
- 🐛 Fix missing stacktraces when throwing bare strings (#324)
- 🐛 Fix bad error message when test contains syntax error (#326)
- 🐛 Fix setTimeout not mocked with useFakeTimers() (#329)
- 🐛 Fix debugging capabilities broken recently (#325)
- 🐛 Fix
loadmoduleenvironment table separation (#320)
- ✨ Added
jest.mockandjest.unmock(#243) - ✨ Added
jest.requireActual(#294) - ✨ Jest runner caches loaded module functions to improve runtime (#317)
- 🐛 Fixes error when no config is provided (#314)
- 🛠️ Realigned packages
- 🐛 Fix
requirethrowing on ModuleScripts thatreturn niland not throwing on ModuleScripts that return multiple values #292
- 🐛 Fix typing for expect matchers #271
- ✨ export additional
expectExtendedfromJestGlobalsto allow use of custom matchers #271 - ✨ Added support for
expect.resolvesandexpect.rejects#262 - ✨ Remove the need for
return {}for test files #279
- ✨ Added
expect.assertions(number)andexpect.hasAssertions()functions (#256)
- 🚨
jest.resetSnapshotSerializerremoved (#253) - 🐛 Fix
PrettyFormatPluginErrornot throwing on invalid plugins (#250) - 🐛 Fix
snapshotSerializersconfig option not working (#251) - 🐛 Fix crash when no tests are discovered (#252)
- 🐛 Fix
testPathIgnorePatternsconfig option crashing (#259)
- ✨ Added
task.delay()andtime()as fake timers (#242) - 🐛 Fix test result message for failing test (#237)
- 🐛 Fix
testNamePatternconfig value (#232) - 🐛 Fix
.eachfor template syntax (#246) - 🛠️ Update LuauPolyfill to v1.0.0 (#237)
- 🛠️ Update Roact to v17.0.1-rc.16 (#237)
- 🛠️ Explicitly license files (#235)
- ✨ Port
jest-config(#203) - ✨ Port
jest-core(#203) - ✨ Port
jest-validate(#203) - 🛠️ Adjust other modules to work with
jest-core(#203) - 🛠️ Update LuauPolyfill to v0.4.1 (#215)
- 🛠️ Update Roact to v17.0.1-rc.13 (#215)
- 🛠️ Update Picomatch to v0.3.0 (#215)
- ✨ Port
jest-runner(#197) - ✨ Port
jest-runtime(#178) - ✨ Create
jest-environment-luau, based onjest-environment-node(#197) - 🛠️ Add integration test of ported libraries, using jest's runner to run tests. (#197)
- 🛠️ Disable
chalk-luawhen running in Studio environment - 🛠️ Extract
AssertionErrortoLuauPolyfill(#186) - 🐛 Fix custom throwing matchers failing when throwing strings (#186)
- 🐛 Fix Jest reporters not reporting test failure to
TestService(#188)
- ✨ Added adapters for Jest reporters (#179)
- Added ability to pipe together reporters
- ✨ Added ReactTestComponent serializer (#174)
- ✨ Added React element serializer (#170)
- ✨ Port
jest-reporters(#167) - ✨ Port
jest-console(#157) - ✨ Port
jest-test-result(#155) - ✨ Port
jest-types(#137) - ✨ Realigned package versions to v27.4.7 (#135)
- ✨ Port
jest-environment(#139) - ✨ Port
jest-each(#145 #158)- Support array like tables
- Support template like tables
- ✨ Port
jest-utilandpicomatch(#144 #154) - 🐛 Clean up assertion errors warning (#181)
- 🛠️ Apply
styluato the whole repo and enable check on CI (#147)
- 🐛 Fix error reporters not outputting captured errors when using non-default reporters (#131)
- ✨ Added support for Roblox Instance objects (#127)
- Added object serialization for Instances
- Added
.toMatchInstancematcher to match against Instances .toMatchSnapshotnow serializes and matches against Instances
- 🛠️
jest.fn()additionally returns a forwarding function for tests that require a mock to be a function - 🛠️ Test reporter is now colorized and reports name of the failing test (#126)
- 🐛 Fix for a bug with throwing matchers and the
Errorpolyfill inroact-alignment(#128)
- 🐛 Check that thrown message is a string when matching against a thrown string (#124)
- ✨ Introduced strong Luau typing (#102)
- ✨ Realigned package versions (#102)
diff-sequencesrealigned to v27.2.5jestrealigned to v27.2.5jest-diffrealigned to v27.2.5jest-fake-timersrealigned to v27.0.6jest-matcher-utilsrealigned to v27.2.5jest-snapshotrealigned to v27.0.6
- 🐛 Fix for
expect.anynot working with Roblox datatypes (#119) - 🐛 Lazy initialize
game:GetServicecalls to avoid throwing in debugger (#122) - 🐛 Fix missing stacktrace entries in nested pcalls (#121)
- ✨ Added support and better output for Roblox datatypes (#117)
- 🛠️ Bump
LuauPolyfillto0.2.5to fix static analysis issues onlua-apps
- 🛠️ Bump
RegExpto0.1.3andLuauPolyfillto0.2.4to remove test files from cached versions - 🛠️ Republish with rotriever
0.5.0-rc.4to remove tests from rotriever cache - 🛠️ Add typing for
RegExp
- 🐛 Resolve dependency cycle in
JestSnapshotandExpect
- ✨ Changed project structure to use rotriever
0.5.0workspaces (#96)- This allows downstream projects to pull individual
JestRobloxpackages as dependencies - For example, to pull the
JestDiffpackage as a dependency:
JestDiff = "github.com/Roblox/jest-roblox@2.1.0" local JestDiff = require(Packages.JestDiff) - This allows downstream projects to pull individual
- 🚨 Due of the above change,
JestRobloxis now used by pulling theJestGlobalspackage in yourrotriever.toml:- Change your
rotriever.tomldependency to
+ JestGlobals = "github.com/Roblox/jest-roblox@2.1.0" - JestRoblox = "github.com/Roblox/jest-roblox@2.0.1"
- Now that the dependency is
JestGlobals, you no longer need to get theGlobalsmember ofJestRoblox
+ local JestGlobals = require(Packages.JestGlobals) + local expect = JestGlobals.expect - local JestRoblox = require(Packages.JestRoblox).Globals - local expect = JestRoblox.expect
- Change your
- 🛠️ Support for named functions in error output (#95)
- 🛠️ Support for
LuauPolyfillSetobject in matchers (#101) - 🛠️ Remove unhelpful lines in error stacktraces (#105)
- 🐛 Fix for snapshot property matchers not working (#93)
- 🐛 Fix snapshot path resolution for snapshot updates on windows (#97)
- 🐛 Fix for
JestSnapshotthrowing in environments whereFileSystemServicedoes not exist (#103) - 🐛 Fix for snapshot names with special characters (#108)
- 🐛 Fix for snapshot matchers not correctly throwing when the matcher fails (#92)
- ✨ Added
JestSnapshotfunctionality- Added
toMatchSnapshotmatcher - Added
toThrowErrorMatchingSnapshotmatcher - Added custom snapshot matchers and property matchers, refer to the "Snapshot Testing" section of the documentation for more info
- Added
UPDATESNAPSHOTflag for updating snapshots, the value can either beall(by default), ornewto only add new snapshots, this can be enabled with an--updateSnapshotflag in Jest Lua CLI
- Added
- 🚨 Removed colon syntax alias for initializing mock functions
- 🛠️
--fastFlags.overrides "UseDateTimeType3=true"removed as it is no longer needed - 🐛 Fix issue with CoreScriptConverter and the Modules directory (#79)
- 🐛 Fix for chalked strings throwing when used with string matchers (#85)
- 🐛
.toThrowmatchers now recognizejest.fnas callable (#87)
- 🐛 Fix for
JestSnapshotso that the init file returns a value (#71)
- 🐛 Fix in
getTypefor objects with a throwing__indexmetamethod (#69)
- ✨ Added
toStrictEqualmatcher - 🚨 Changed syntax for intializing mock functions from
jest:fn()tojest.fn()(the colon syntax is left in for compatibility but will be removed in 2.0) - 🚨
RegExpis pulled out from the LuauPolyfill repo into a separate LuauRegExp repo and lazily loaded (#62) - 🛠️ Added instantiating mock function instance with
mockFn.new()(#52) - 🛠️ Changed the
ArrayContainingasymmetric matcher to output curly braces instead of square brackets (#55) - 🛠️ Added proper output formatting for Roblox
Instancetypes (#64) - 🐛 Bugfix in
SpyMatcherswhere function calls withnilarguments would not be handled correctly (#53)
- ✨ Added spyMatchers
expect().lastCalledWith() also aliased as expect().toHaveBeenLastCalledWith()
expect().lastReturnedWith() also aliased as expect().toHaveLastReturnedWith()
expect().nthCalledWith() also aliased as expect().toHaveBeenNthCalledWith()
expect().nthReturnedWith() also aliased as expect().toHaveNthReturnedWith()
expect().toBeCalled() also aliased as expect().toHaveBeenCalled()
expect().toBeCalledTimes() also aliased as expect().toHaveBeenCalledTimes()
expect().toBeCalledWith() also aliased as expect().toHaveBeenCalledWith()
expect().toReturn() also aliased as expect().toHaveReturned()
expect().toReturnTimes() also aliased as expect().toHaveReturnedTimes()
expect().toReturnWith() also aliased as expect().toHaveReturnedWith()
- ✨ Added basic
JestMockfunctionality- The
jestobject can be imported fromGlobalsand has the following methods:.fn().clearAllMocks().resetAllMocks().restoreAllMocks()
- The
- 🛠️ Added
Errortype toJestGetType(#45) - 🐛 Bugfix in
.toMatchwhere strings go into the RegEx check (#41) - 🐛 Bugfix for
.toThrownot matchingErrorobject with same message (#44)
- ✨ Added chalk-enabled error output (#38)
- 🛠️ Added
userdataandthreadLuau types toJestGetType(#39) - 🐛 Fix for checking for an
asymmetricMatchmethod for objects that override__indexmetamethod (#39)
- ✨ Added
expect.extend()(#35) - 🛠️ Added
RegExpsupport to matchers (#32) - 🛠️ Added prototype information to matchers (#34)
- ✨ Added
expect().toThrow()(#30)
- ✨ Initial release of Jest Lua, TestEZ has been rebranded as of this release.
- ✨ Added
expectaligned to Jest's expect (26.5.3)- Requires an explicit
requirefromJestRoblox.Globalsto use - Refer to the Jest documentation on expect for usage documentation. Refer to the
README.mdinsrc/Modules/expectfor details on deviations from upstream expectmatchers added:
expect().toBe() expect().toBeCloseTo() expect().toBeDefined() expect().toBeFalsy() expect().toBeGreaterThan() expect().toBeGreaterThanOrEqual() expect().toBeInstanceOf() expect().toBeLessThan() expect().toBeLessThanOrEqual() expect().toBeNan() (aliased as toBeNaN) expect().toBeNil() (aliased as toBeNull) expect().toBeTruthy() expect().toBeUndefined() expect().toContain() expect().toContainEqual() expect().toEqual() expect().toHaveLength() expect().toHaveProperty() expect().toMatch() expect().toMatchObject()asymmetricMatchersadded:
expect.any() expect.anything() expect.arrayContaining() expect.arrayNotContaining() expect.objectContaining() expect.objectNotContaining() expect.stringContaining() expect.stringNotContaining() expect.stringMatching() expect.stringNotMatching()- Custom
asymmetricMatchersfor any objects with aasymmetricMatch(self, other)method - Negative variants of all the above matchers with the keyword
never, i.e.expect().never.toBe()orexpect.never.stringContaining() - TestEZ
expectwill be removed soon
- Requires an explicit
afterEachblocks now run their code afteritblocks fail or error
- Added
expect.extendwhich 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
passand a stringmessage - Like
context, matchers introduced viaexpect.extendwill be present on all nodes below the node that introduces the matchers. - Limitations:
expect.extendcannot be called from withindescribeblocks- Custom matcher names cannot overwrite pre-existing matchers, including default matchers and matchers introduces from previous
expect.extendcalls.
- 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.tracebackas 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
- Remove the lifecycle hooks from the session tree. This prevents the
[?]spam from the reporter not recognizing these nodes.
- 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.
- Further simplify
beforeAllhandling.beforeAllnow runs on entering the block, rather than on the firstitencountered after entering the block. The major difference for the moment is that abeforeAllwill now run even if there are noitblocks under it, which is now consistent with howafterAllworked.beforeAllandafterAllnow report errors by creating a dummy node in the results to contain the error. Previously, errors inafterAllwere not reported.- A failure in a
beforeAllblock will now halt all further test execution within its enclosingdescribeblock except for any remainingbeforeAllblocks and anyafterAllblocks. MultiplebeforeAllorafterAllblocks within onedescribeblock should not count on running in any specific order.afterAllblocks should account for the possibility of a partially setup state when cleaning up.
- Add a context object visible from lifecycle hooks and
itblocks. 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.
- Remove the
trynode type.- Remove the
stepalias foritsince that's meant for use withtry.
- Remove the
- Remove the
includeglobal 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
describeanditblocks with duplicate descriptions will now not overwrite the earlier copies of those nodes. - Duplicate
itnodes within onedescribewill raise an error. - TestPlanBuilder was removed from the API.
- The major visible change is that
- Fixed a bug with how
beforeAllandafterAllhandled 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.
- 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)
- Added beforeAll, beforeEach, afterEach, afterAll lifecycle hooks for testing
- The setup and teardown behavior of these hooks attempt to reach feature parity with jest.
- Initial release.