1.1.2 • Published 3 years ago

testus v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Introduction

A Test Kit for Vee

testus is a Test Kit in Front End, which can help Developers to TEST your own projects. We concern multiple kinds of tests, such as Unit Test, Integration Test and E2E Test (UI Test), which can cover most of your test case for Front End.

Feature

  1. Support parse notation to get what you wanna test;

  2. Support testus.config.js to customize your own options;

  3. Support vscode icons for testus.config.js to beautify your IDE;

  4. Support cli plugin to perform your Develop Experience. Officially, we only support plugin for our own cli but you can customize your plugin which we expose a plugin api.

Installation

npm install testus

Quick Start

In your root directory, you'd better to create a testus.config.js. If we can't find testus.config.js in your root directory, we set a default configuration:

module.exports = {
    entry: {
        // path which you want to observe based to the root directory
        dirPath: '',
        // what types file you want to watch
        extFiles: ['js'],
        // file or directory which you want to ignore
        excludes: [],
    },
    output: {
        // path which you want to export based to the root directory
        dirPath: 'tests',
        // you want to generate a test file whose middle name you want to define
        middleName: 'spec',
    },
    options: {
        // test libraries you want to test, which supports jest, jasmine and karma right now
        libName: 'jest',
        // test libraries' config, such as jest.config.js, jasmine.config.json and karma.conf.js
        libConfig: {

        }
    },
    // plugin should be a function, which must return a next(ctx) in your plugin params, such as: (ctx, next) => next(ctx)
    plugins: [

    ]
}

Notation

If you want to generate a test file related to your code, you'd better to write a notation in your code. We cite an instance like this:

/**
 * @testus 
 * @name sum
 * @description test sum function
 * @param a 1
 * @param b 2
 * @return 3
 * @testus
 */
const sum = (a,b) => a+b;

/**
 * @end
 */
module.exports = {
    sum
}

we can parse @testus from your code, which you must use @testus closing your notation that can be filtered in our platform. More importantly, you have to write an @end to let us know what you want to export, which now only support Common JS Module.

NotationClosingDescription
@testusyesoffer a scope that need to parse
@namenoan export refer which you want to test
@descriptionnoan description which you want to describe
@paramnoa param which you want to input in your function or sth
@returnnoa return which you want to return in your function or sth
@endnooffer a module.exports

Plugins

ProjectDescription
testus-plugin-jestjest plugin
testus-plugin-karmakarma plugin
testus-plugin-jasminejasmine plugin

Document

License

MIT

Copyright (c) Vee

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago