How to use the @oclif/test.test.stdout function in @oclif/test

To help you get started, we’ve selected a few @oclif/test examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HAECHI-LABS / henesis-cli / src / commands / init.spec.ts View on Github external
'should be able to successfully create folders with git template',
      (ctx): void => {
        const path = join(
          __dirname,
          '..',
          '..',
          `/henesis-cryptokitties-klaytn`,
        );
        rimraf(path, (): void => {});
        expect(ctx.stdout).to.equal(
          'henesis initialization has been completed.\n',
        );
      },
    );

  test
    .stdout()
    .command(['init'])
    .command(['init', '-f'])
    .it(
      'should be able to successfully create folder with force',
      (ctx): void => {
        expect(ctx.stdout).to.equal(
          'henesis initialization has been completed.\nhenesis initialization has been completed.\n',
        );
      },
    );

  test
    .stdout()
    .command(['init'])
    .command(['init'])
github HAECHI-LABS / henesis-cli / src / commands / account / changepw.spec.ts View on Github external
async (): Promise => {
      test
        .stdout()
        .command(['account:changepw'])
        .exit(2)
        .it('should be fail not logged in');
    },
  );
github HAECHI-LABS / henesis-cli / src / commands / config.spec.ts View on Github external
describe('config', (): void => {
  before((): void => {
    process.env.HENESIS_TEST = 'false';
  });

  test
    .stdout()
    .command(['config'])
    .exit(2)
    .it('should fail do not specify an option');

  test
    .stdout()
    .command(['config', '-e', 'http://asdf'])
    .it('should be success to change http url', (ctx): void => {
      expect(ctx.stdout).to.equal('Successfully set to http://asdf\n');
      expect(configstore.get('endpoint')).to.equal('http://asdf');
    });

  test
    .stdout()
    .command(['config', '-e', 'https://asdf'])
github HAECHI-LABS / henesis-cli / src / commands / integration / describe.spec.ts View on Github external
context('when integrationId does not provided', (): void => {
    test
      .stdout()
      .command(['integration:describe'])
      .exit(2)
      .it('exits with status 1 when integrationId does not provided');
  });
});
github HAECHI-LABS / henesis-cli / src / commands / logout.spec.ts View on Github external
describe('logout', (): void => {
  test
    .stdout()
    .command('logout')
    .it('should be successfully logout with message', (ctx): void => {
      expect(ctx.stdout).to.equal(`🤗 Logout Success 👍\n`);
      expect(configstore.get('user')).to.equal(undefined);
      expect(configstore.get('analytics')).to.equal(undefined);
    });
});
github HAECHI-LABS / henesis-cli / src / commands / integration / delete.spec.ts View on Github external
context('when integrationId does not exist', (): void => {
    test
      .stdout()
      .command(['integration:delete'])
      .exit(2)
      .it('exits with status 1 when integrationId does not provided');
  });
});

@oclif/test

test helpers for oclif components

MIT
Latest version published 19 days ago

Package Health Score

86 / 100
Full package analysis