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

tdd-max

v3.0.0

Published

Utility library which help Test Driven development in Cycling '74 Max

Downloads

2

Readme

TDD-Max

Utility library which helps Test Driven Development in Cycling '74 Max

This package works only in Max 8 or higher

What is TDD?

  • Test Driven Development
  • “Test-First” approach in which unit tests are written before code or patcher
  • See more at Wikipedia

Why TDD is important?

  • TDD means fewer bugs, higher quality software, and a razor focus.
  • TDD allows problems to be detected as early as possible
  • See more in this article

Install

Use this command at your project root.

yarn add -D tdd-max

Usage

To use TDD-Max, you need to prepare two things, "test patcher" and "test code" Instead of setting up them manually, you can use our boilerplate with this command.

yarn tdd-max --init

You can pass an argument to indicate the destination path.

yarn tdd-max --init ./projects/test

Test patcher

You can make your test patcher as shown below. If you would like to use this as your boilerplate, this is accessible at boilerplate/test/test.maxpat which is copied by the --init command in the previous section.

Test codes

Here is an example of how you can write your test codes.

// boilerplate/test/code/add1.test.js

const { expect } = require('chai');
const TARGET = 'add1';
test('adds 1 to input number', async () => {
  expect(await fetch(TARGET, { add1: 3 })).to.equal(4);
  expect(await fetch(TARGET, { add1: 0.1 })).to.equal(1.1);
  expect(await fetch(TARGET, { add1: 100000 })).to.equal(100001);
  expect(await fetch(TARGET, { add1: -2.1 })).to.equal(-1.1);
});

For more detailed guide, read the Getting Started

Notes

  • Test codes should be named as *.test.js.
  • Test codes sould be placed in the same folder as your test patcher. You can also use subfolders.
    • tdd will search those folders and load your codes automatically even if you have multiple test files.

Dependencies of your test codes

If you'd like to use some assertion library such as 'chai', please be aware that those libraries should be installed to your project root, not to the folder where the TDD-Max is installed. Sending npm install chai message to tdd patcher will not work, so please use yarn add -D [package-name].

Alternative installation

Though it is highly recommended to use yarn, you can manually install this library in case you are not familiar to that kind of dependency managers.

  1. Download zip file from release page
  2. Unzip
  3. Copy all the contents into a folder which is listed in your File Preference, such as /Users/YourName/Documents/Max 8/Library
  4. Restart Max application if it is running.

PR is welcome!

Though you can file an issue, PR is much more appreciated. The code is simple enough to modify quickly.

For contributors

Prerequisite

  • Node 10.16
  • Yarn
  • Max 8.1.0 or higher

Set up your dev environment

  1. Clone this repository
  2. Add the path of your cloned directory to Options >> File Preference of your Max

Publish

  1. Indicate the version number in the package.json
  2. commit and push
  3. run npm publish Tag will be automatically genearated