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

@raccoons-co/cleanway

v2.6.0

Published

`@Test`-driven development discipline practice.

Downloads

25

Readme

npm version Maintainability Rating codecov CircleCI

A clean way to well-written TypeScript prose in the Node.js galaxy.

TypeScript 5.0 have implemented the new decorators standard! 
It's not required to enable experimental support for decorators any more.

Clean Way

The library provides an EntryPoint to @Test-driven development discipline practice with Typescript.

  • @TestClass is used to annotate a class that contains test methods.

  • @Test is used to annotate a method as test method to check the correct behaviour/functionality, features of an application.

  • @ParameterizedTest is used to annotate a method as parameterized test method. @ParameterizedTest methods must specify at least one @ArgumentsSource.

  • @ArgumentsSource is a repeatable annotation that is used to provide an Array of Arguments that will be used to invoke the parameterized test method.

  • @RepeatedTest is used to annotate a method as test template method that should be repeated a specified number of times. Repeated test behaves like a regular @Test method.

  • @BeforeEach is used to annotate a transition method that will be executed before each test method in the current test class.

  • @AfterEach is used to annotate a transition method that will be executed after each test method in the current test class.

  • @DisplayName is used to declare a custom name for the annotated test class or test methods.

Test methods, transition methods must not be private or static and must not return a value.

Each test is executed separately with own object of a test class.

Cleanway is friendly to Istanbul test coverage tool.

Simple auto-start

Create a new repository from cleanway-skeleton template.

Manual start

Install package as development dependency.

% npm i -D @raccoons-co/cleanway

Implement src/test/EntryPoint.ts:

import {CleanWayBuilder} from "@raccoons-co/cleanway";
import YourTest from "./YourTest";

CleanWayBuilder.instance()
    .use(YourTest)
    .build();

Implement src/test/YourTest.ts in accordance to this example.

Create src/main/YourProgram.ts.

Finally paste script to package.json to run your tests in execution environment with coverage reporting:

"scripts": {
  "test": "nyc ts-node src/test/EntryPoint"
}

Do not forget to install istanbul, ts-node as development dependencies and review .nycrc.json as well.

Run

Now you are ready to follow clean way. Run test locally and with continuous integration platform.

% npm test

Write YourTest cases, fail fast and have a nice journey in the Node.js galaxy.

Read the story Clean Way: A Node.js galaxy adventures.

Support us with €1