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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nx-morpheus/xetest

v0.1.0

Published

TypeScript-first, integration-friendly test runner for the Xronox ecosystem

Readme

@xronoces/xetest

TypeScript-first, integration-friendly test runner for the Xronox ecosystem.

Overview

xetest is a test runner designed for integration testing in the Xronox ecosystem. It:

  • Runs tests using a Jest/Vitest-like DSL (describe, test, expect, hooks)
  • Uses real databases via @xronoces/xronox as the data tier
  • Uses real APIs (HTTP calls) when tests say they need them
  • Standardizes logging via logs-gateway (with Shadow Logging)
  • Centralizes all config via nx-config2

Installation

npm install --save-dev @xronoces/xetest

Quick Start

Create a test file:

// src/my.test.ts
import { describe, test, expect, useTestContext } from '@xronoces/xetest';

describe('my feature', () => {
  test('does something', () => {
    expect(1 + 1).toBe(2);
  });
});

Run tests:

npx xetest

Configuration

Create a .env.test file:

# Database (xronox/nxMongo)
XETEST_DB_ENABLED=true
XETEST_DB_ENGINE=nxMongo
XETEST_DB_NAME=xetest

# Logging
XETEST_LOG_LEVEL=debug
XETEST_LOG_FORMAT=text
XETEST_LOG_TO_CONSOLE=true

# Shadow logs for CI
XETEST_SHADOW_ENABLED=true
XETEST_SHADOW_PER_TEST=true
XETEST_SHADOW_DIR=./test-artifacts/shadow

# API
XETEST_API_ENABLED=true
XETEST_API_BASE_URL=http://localhost:3000
XETEST_API_TIMEOUT=10s

Usage Examples

Pure Unit Tests

import { test, expect } from '@xronoces/xetest';

test('pure function', () => {
  const input = { a: 1, b: 2 };
  const result = myFn(input);
  expect(result).toEqual({ sum: 3 });
});

Database Tests

import { describe, test, expect, useTestContext } from '@xronoces/xetest';

describe('user database', () => {
  test('writes to DB', async () => {
    const ctx = useTestContext();
    await ctx.withDb(async (xronox) => {
      await xronox.write({
        dataType: 'metadata',
        sourceType: 'database',
        subSourceType: 'mongo',
        source: 'users',
        document: { email: '[email protected]' },
      });

      const users = await xronox.read({
        dataType: 'metadata',
        sourceType: 'database',
        subSourceType: 'mongo',
        source: 'users',
        query: { email: { $eq: '[email protected]' } },
      });

      expect(users.length).toBe(1);
    });
  }, { tags: ['db'] });
});

API Tests

import { describe, test, expect, useTestContext } from '@xronoces/xetest';

describe('user API', () => {
  test('creates user via API', async () => {
    const { httpClient, logger, runId } = useTestContext();

    const res = await httpClient!.post('/api/v1/users', {
      email: '[email protected]',
      password: 'test123',
    });

    expect(res.status).toBe(201);
  }, { tags: ['api'] });
});

Integration Tests (DB + API)

import { describe, test, expect, useTestContext } from '@xronoces/xetest';

describe('user profile API', () => {
  test('creates user in DB via API', async () => {
    const { httpClient, xronox, logger } = useTestContext();

    const res = await httpClient!.post('/api/v1/users', {
      email: '[email protected]',
    });

    expect(res.status).toBe(201);

    const users = await xronox!.read({
      dataType: 'metadata',
      sourceType: 'database',
      subSourceType: 'mongo',
      source: 'users',
      query: { email: { $eq: '[email protected]' } },
    });

    expect(users.length).toBe(1);
  }, { tags: ['db', 'api'] });
});

CLI

# Run all tests (default patterns)
npx xetest

# Run specific patterns
npx xetest "src/**/*.test.ts"

# With env config overrides
XETEST_DB_NAME=xetest \
XETEST_LOG_LEVEL=debug \
npx xetest

Test Tags

Tests can be tagged to indicate their requirements:

  • 'db' - Requires database (xronox)
  • 'api' - Requires API (httpClient)
  • 'slow' - Slow-running test

If a test requires a resource that's not available, it will be skipped with a clear reason.

Configuration Options

See docs/specs.md for full configuration documentation.

License

ISC