npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rbxts/lunit

v3.0.1

Published

[NPM Registry](https://npmjs.org/@rbxts/lunit) # @rbxts/lunit

Downloads

215

Readme

NPM Registry

@rbxts/lunit

@rbxts/lunit is a testing library for Roblox TypeScript projects, providing a simple and efficient way to write and run tests.

Features

  • Easy to Use: Simple and intuitive API for writing tests.
  • TypeScript Support: Fully supports TypeScript, making it easy to write and maintain tests.
  • Integration with Roblox: Designed specifically for Roblox projects, ensuring seamless integration.
  • Customizable Reporters: Built-in support for custom reporters to format test results as needed.
  • Comprehensive Assertions: Provides a wide range of assertions to validate your code.
  • Define Testing Criteria: Using native Typescript Decorators, you can define criteria/properties for each of your tests, making them easier to manage and organize!

Why Use @rbxts/lunit

  • No Dependencies: The library has no dependencies, making it lightweight and easy to integrate with your current game or framework.
  • Robust Testing: Comprehensive assertions and easy-to-use functions for thorough testing.
  • Minimal, But Powerful: The syntax for writing tests is underwhelming, but it also exposes all sorts of APIs for writing flexible tests.

Installation

To install the library, use npm:

npm install @rbxts/lunit

Usage

Writing Tests

Tests in LUnit can be defined as a simple TypeScript class. Each test is treated like a module, so you'll export the class definition as the module. Here's an example:

// ReplicatedStorage/Tests/SomeTest.spec.ts
import { Test, DisplayName, Assert } from "@rbxts/lunit";

// this is the function we're testing
function sum(a: number, b: number): number {
	return a + b;
}

class TestClass {
	@Test
	sumTwoNums() {
		Assert.equals(sum(5, 5), 10);
		Assert.notEqual(sum(5, 5), 999);
	}
}

export = TestClass; // export the class as a module

Running Tests

To run your tests, use the following npm script:

// SomeScript.server.ts
import { ReplicatedStorage } from "@rbxts/services";
import { TestRunner } from "@rbxts/lunit";

const testRunner = new TestRunner([
	ReplicatedStorage.FindFirstChild("Tests"), // the folder containing all your test modules
]);

testRunner.run();

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Author

Brandon Kong