JSPM

arvish-test

0.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 11
    • Score
      100M100P100Q45587F
    • License MIT

    Test your Arvish extensions

    Package Exports

    • arvish-test

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (arvish-test) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    arvish-test

    BuildStatus NPM download total NPM version MIT license PR's Welcome

    Test your arvish extensions

    This lib is inspired and cloned from alfy-test.

    If you're trying to use this lib, please note that API is different from alfy-test.

    • Some environment variables are not supported yet. You could check which envs is supported on here

    • XML scriptfilter not supported.

    Install

    $ npm install --save-dev arvish-test

    Usage

    // Note: API is different from 'alfy-test'.
    import test from 'ava';
    import arvishTest from 'arvish-test';
    
    test('foo', async t => {
        const arvish = arvishTest({
            vars: {
                query: 'foo bar'
            }
        });
    
        // Below script is replaced with "node index.js foo\\ bar"
        const result = await arvish("node index.js {query}");
    
        t.deepEqual(result, [
            {
                title: 'foo',
                subtitle: 'bar'
            }
        ]);
    });

    API

    arvishTest(options?)

    Returns an mock arvish instance.

    options

    Type: object

    version

    Type: string
    Default: arvish-test

    Arvis version.

    env

    Type: object\

    You can put unsupported environment variables values through env

    vars

    Type: object\

    You can put query or other variables vars

    arvish(script)

    Returns a Promise that returns the items of the workflow.

    script

    Type: string

    Script to test.

    .config

    The arvish config instance.

    .cache

    The arvish cache instance.

    • arvish - Arvis workflow, plugin creator tools