sindresorhus / meow

🐈 CLI app helper
MIT License
3.53k stars 150 forks source link

Add test for `unnormalizedFlags` with `aliases` #227

Closed tommy-mitchell closed 1 year ago

tommy-mitchell commented 1 year ago

Adds a test case to make sure that cli.unnormalizedFlags works correctly with the new aliases option:

test('aliases - unnormalized flags', t => {
    t.deepEqual(meow({
        importMeta,
        argv: ['--foo=baz'],
        flags: {
            fooBar: {
                type: 'string',
                aliases: ['foo'],
                shortFlag: 'f',
            },
        },
    }).unnormalizedFlags, {
        fooBar: 'baz',
        foo: 'baz',
        f: 'baz',
    });
});