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

kt-testing-suite-core

v1.8.5

Published

![KT Testing Suite Banner](docs/img/banner_testing_suite.jpg)

Readme

KT Testing Suite Banner

KT Testing Suite

Welcome to the KT Testing Suite! This suite provides a comprehensive set of tools for testing ExtendScript scripts writen in TypeScript.

Overview

The suite is designed with Vitest in mind, ensuring they function correctly and efficiently. It includes a variety of matchers and extensibility features to cover a wide range of testing scenarios.

Also, KT Testing Suite is integrated with KT Create Plugin, so you can develop Adobe scripts in ExtendScript with TypeScript.

All this enviroment is based on Bolt CEP building code, so you can use it with Bolt itself. Also it uses Types for Adobe for Adobe Apps Typescript support.

Installation

To install the KT Testing Suite, use the following command:

npm install kt-testing-suite-core

Writing Tests

Here are some examples of how to write tests using the KT Testing Suite:

// src/tests/my-tests.test.ts
import { describe, it, expect } from "kt-testing-suite-core";

describe("Example Test Suite", () => {
  it("should pass this test", () => {
    expect(true).toBe(true);
  });

  it("should match the snapshot", () => {
    const result = { key: "value" };
    expect(result).toBeEqual({ key: "value" });
  });
});

Adobe Type Helpers

For Adobe applications (After Effects, Premiere, etc.), use type helpers to avoid TypeScript errors when accessing Adobe-specific properties:

import { expect, asAdobeType, isAdobeType } from "kt-testing-suite-core";

// Safe type assertion
const layer = asAdobeType<AVLayer>(this.actual);
expect(layer.source.mainSource).toBeInstanceOf(FootageSource);

// Type guard
if (isAdobeType(someLayer, AVLayer)) {
  // TypeScript now knows it's an AVLayer
}

Build Tests

To transpile tests to Extendscript run:

npm run build-tests

Run Tests

To execute tests, use the ExtendScript Debugger, making sure you point to your tests entry file, by default is dist.test/index.test.ts.

Output:

Suite: Example Test Suite
  Test: should pass this test
    ✅ Passed
  Test: should match the snapshot
    ✅ Passed

Test Results:
Passed: 2
Failed: 0

Using Hooks

The testing suite supports hooks for setup and teardown operations:

  • beforeEach(): Runs before each test
  • afterEach(): Runs after each test
  • beforeAll(): Runs once before all tests in a suite
  • afterAll(): Runs once after all tests in a suite

Hooks can be nested and are useful for initializing test data, cleaning up resources, or resetting state.

Example:

describe("My Tests", () => {
  let data;

  beforeAll(() => {
    data = "initialized"; // Setup once
  });

  beforeEach(() => {
    data = "reset"; // Reset before each test
  });

  it("should use fresh data", () => {
    expect(data).toBe("reset");
  });
});

For detailed examples and advanced usage including nested hooks, see the Hooks Documentation.

Documentation

For more detailed documentation, please refer to the specific README files in the docs folder:

Test Files

You can find the test files in the src/tests directory:

For more examples and detailed usage, please refer to the test files in the repository.

Links