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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@k-foss/ts-estests

v1.0.7

Published

@k-foss/ts-estests is a lightweight testing framework for use with ESNext & ESModules code

Downloads

14

Readme

@K-FOSS/TS-ESTests

semantic-release Code Quality code style: prettier Libraries.io dependency status for latest release, scoped npm package Conventional Commits Dependabot

@K-FOSS/TS-ESTests is a lightweight testing framework for use with ESNext & ESModules code. Orignally created within my @K-FOSS/TS-ESNode repo for testing.

Usage

This is an ESModule and requires Node.JS 13.9 or newer

Install the module

npm install @k-foss/ts-estests

Test Suite [Tests/Add.test.ts]

// Tests/AddTest/add.test.ts
import { TestSuite } from '@k-foss/ts-estests';
import { strictEqual } from 'assert';
import { add } from '../src/Add';

export class AddTest extends TestSuite {
  public testName = 'addTest';

  public async test(): Promise<void> {
    strictEqual(add(1, 1), 2, 'add(1, 1) === 2');

    strictEqual(add(1, 2), 3, 'add(1, 2) === 3');

    strictEqual(add(5, 5), 10, 'add(5, 5) === 10');
  }
}

Source file your testing src/Add.ts

// src/Add.ts
export function add(a: number, b: number): number {
  return a + b;
}

Example package.json

{
  "type": "module",
  "scripts": {
    "test": "ts-estest ./Tests"
  }
}

Development

Setting up the development container

Follow these steps to open this project in a container:

  1. If this is your first time using a development container, please follow the getting started steps.

  2. To use this repository, you can either open the repository in an isolated Docker volume:

    • Press F1 and select the Remote-Containers: Open Repository in Container... command.
    • Enter K-FOSS/TS-ESTests
    • The VS Code window (instance) will reload, clone the source code, and start building the dev container. A progress notification provides status updates.

    Or open a locally cloned copy of the code:

    • Clone this repository to your local filesystem.

      • git clone https://github.com/K-FOSS/TS-ESTests.git
    • Open the project folder in Visual Studio Code.

      • code ./TS-ESTests
    • Reopen in Container

      • When you open the project folder in Visual Studio Code you should be prompted with a notification asking if you would like to reopen in container.

      Or manually reopen

      • Press F1 and select the "Remote-Containers: Open Folder in Container..." command.

TODO

TBD

Testing

MUST HAVE NODE.JS v13.9 or newer

To try this out, clone repo

Install NPM modules

npm install

Run all tests under ./Testing/Tests/

npm test

All tests are run on all commits and PRs.

Style

This project currently uses Prettier for code styling and automatic formatting. Prettier is run on every commit and pull request.

Run Prettier

npm run prettier

Linting

This project currently uses ESLint for code linting. ESLint is run on every commits and pull request.

Run ESLint

npm run lint

Dependency Management

Dependency Management for TS-ESTests is handled by automated pull requests created by Dependabot. When new released of development Dependencies are released Dependabot automatically creates a pull request for upgrading to the new version. If the created pull request passes the GitHub Actions testing, prettier/styling, and linting I will merge the pull request.

Releases

@K-FOSS/TS-ESTests uses semantic-release to intelligently automate the creation of a changelog, automatic package publish to NPM, along with creating a GitHub release and tag.

Semantic-Release is currently configured to analyze commits with the Conventional Commits preset to determine if and how the package version should be incremented and if a release should be published, which is why it is important to mantain the Conventional Commits spec for all commits.