C
CanxJS
v1.6.2
  • Learn
  • Blog
  • Showcase
C
CanxJS

Ultra-fast async MVC backend framework for Bun. Build production-ready APIs with elegance and speed.

Resources

  • Documentation
  • Learn
  • Blog
  • Showcase

Documentation

  • Introduction
  • Installation
  • Core Concepts
  • CLI Commands
  • API Reference

Legal

  • Privacy Policy
  • Terms of Service

© 2026 CanxJS. All rights reserved.

Built with ❤️ for Candra Kirana

Quality Assurance

Testing

Write reliable, maintainable tests for your CanxJS applications. Leverage Bun's blazing-fast native test runner for unit, integration, and end-to-end testing.

Why Test with CanxJS?

Bun's native test runner - ultra-fast execution
Built-in mocking and spying utilities
Snapshot testing support
Code coverage reports
Watch mode for development
TypeScript support out of the box

Getting Started

Installation & Setup

Configure testing environment with Bun's built-in test runner

Usage Guide

Write and run tests for your CanxJS applications

Unit Testing

Test individual components, services, and utilities

Quick Start

example.test.ts
import { describe, test, expect } from "bun:test";
import { createApp } from "canxjs";

describe("API Tests", () => {
  test("GET / returns hello message", async () => {
    const app = createApp({ port: 0 });
    
    app.get("/", (req, res) => {
      res.json({ message: "Hello CanxJS!" });
    });

    const response = await app.request("/");
    const data = await response.json();
    
    expect(response.status).toBe(200);
    expect(data.message).toBe("Hello CanxJS!");
  });
});

Run tests with: bun test

Start Testing

Set up your testing environment and write your first test.