Skip to content

Automatically run unit tests when ModuleScript code changes in Roblox Studio ⚡

License

Notifications You must be signed in to change notification settings

benbrimeyer/rbx-plugin-testServiceWatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rbx-plugin-testServiceWatcher

This plugin was created to automatically run my unit tests whenever Rojo syncs module script code to watched directories.

Purpose

The purpose of this module was to help accelerate my workflow as I develop my projects with TDD in mind. As I constantly switch tabs within VSCode to write tests and then write code that passes these tests, I had little time left to also switch my active window between VSCode and Roblox Studio.

This plugin aims to eliminate the need to focus Roblox Studio to run these tests. Now I can focus on VSCode and keep an eye on the output window in Roblox Studio.

.GIF Demo

https://i.imgur.com/MBm8Fkn.gifv (I was lazy and the git is pretty wide. You may have to zoom out in-browser to see it all)

Setup

First you'll need to build this plugin using Rojo.

How to build this plugin with Rojo

(instructions and x0.5 support coming soon)


Once the plugin is compiled and installed, you'll want to set up your projects to include the watcher command that will kick off the plugin.

Create your watcher file

Your watcher file is a JSON array that tells the plugin which datamodel directories you would like to watch. It should look something like this:

[
	"ReplicatedFirst",
	"ReplicatedStorage",
	"ServerStorage",
	"ServerScriptService"
]

Import your watcher file with Rojo

Now you'll have to include your watcher file into your Rojo project. Note: The watcher file must be named __watcher and be placed directly into ServerStorage.

Rojo 0.4.x

"watcher": {
	"path": "path/to/watcher",
	"target": "ServerStorage.__watcher"
}

Write unit tests!

You're pretty much ready to go now. I would recommend writing your unit tests using TestEz. For this plugin to work, you'll need to write your test bootstrapper as a normal Script object placed directly into TestService.

Link to TestService setup with bootstrap code

coming soon.

About

Automatically run unit tests when ModuleScript code changes in Roblox Studio ⚡

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages