malaby
Easy and fast test runner to run any kind of test
Last updated a year ago by segevofer .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install malaby 
SYNC missed versions from official npm registry.

Malaby

Easy and fast test runner to run any kind of test

Supports:

  • Running any kind of test
  • Easily watch for changes, and re-run the test using --watch
  • Easily debug any node based test using --debug
  • Helps big teams collaborate

use this wiki page to configure your IDE

Getting Started

install malaby (recommended to install globally):


npm i -g malaby # recommended

## OR ##

npm i --save-dev malaby

Prerequisites

You must have npx installed (or an npm version bigger than 5.2.0 that uses npx) and ndb if you want to debug tests

It is recommended to install them globally


npm i -g npx ndb

Installing

After installing malaby, go to the root of your project and run:


malaby init

This will create a new file named malaby-config.json

Example:

root-of-project/malaby-config.json:

{
  "tests": [
    {
      "pattern": "*.unit.js",
      "command": "yarn unit-test ${filePath}",
      "debugCommand": "grunt someOtherTask -test=*${fileName}* --debug",
      "filesToWatch": [
        ".json",
        ".jsx"
      ]
    },
    {
      "pattern": "*.spec.js",
      "command": "node js/test/jasmine.js ${filePath}"
    }
  ],
  "filesToWatch": [
    ".js"
  ]
}

In this file, declare the test types in your project, under "tests" array.

Each test looks like this:

  • pattern (mandatory) - a glob describing how to locate the tests.

  • command (mandatory) - how to run the test. You can use either ${filePath} or ${fileName}

    ${filePath} - is the absolute path of the test file. for example: /path/to/yourFile.unit.js

    ${fileName} - is the name of the file. for example: yourFile.unit.js

  • debugCommand - just like "command", but lets you run different command when --debug flag is on

  • filesToWatch - an array of file extensions to watch in the project, when --watch flag is on

Example of a single test config:

{
  "pattern": "*.unit.js",
  "command": "yarn unit-test ${filePath}",
  "debugCommand": "grunt someOtherTask -test=*${fileName}* --debug",
  "filesToWatch": [
    ".json",
    ".jsx"
  ]
}

Usage

malaby path/to/testFile.yourSuffix.js

Additional options:

   --watch      re-run the test every file change in the project
   --debug      run debugCommand for this test, if found in malaby-config.json file
   --ndb        run the test with ndb (https://www.npmjs.com/package/ndb)
   --config     specify different config file --config=different-malaby-config.json

You can easily configure your IDE to use Malaby.

a word about --watch

By default, Malaby watch for .js file changes only.

You can specify a global "filesToWatch" array or per test type under "tests" (like in the example above).

You can use any CLI command that is installed in your node_modules (node, npm, grunt, eslint, etc...)

Contributing

Please feel free to create pull requests

Authors

Ofer Segev - Github

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Current Tags

  • 1.0.23                                ...           latest (7 months ago)

24 Versions

  • 1.0.23                                ...           7 months ago
  • 1.0.22                                ...           7 months ago
  • 1.0.21                                ...           a year ago
  • 1.0.20                                ...           a year ago
  • 1.0.19                                ...           a year ago
  • 1.0.18                                ...           a year ago
  • 1.0.17                                ...           2 years ago
  • 1.0.16                                ...           2 years ago
  • 1.0.15                                ...           2 years ago
  • 1.0.14                                ...           2 years ago
  • 1.0.13                                ...           2 years ago
  • 1.0.12                                ...           2 years ago
  • 1.0.11                                ...           2 years ago
  • 1.0.10                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (7)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |