Skip to content

Commit

Permalink
chore: restore tests, but commented out
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcarman committed May 3, 2024
1 parent 815926a commit 6099349
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions test/commands/metalint/run.nut.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit';
import { expect } from 'chai';
import { TestSession } from '@salesforce/cli-plugins-testkit';
// import { expect } from 'chai';

describe('metalint run NUTs', () => {
let session: TestSession;
Expand All @@ -12,10 +12,10 @@ describe('metalint run NUTs', () => {
await session?.clean();
});

it('should display provided name', () => {
const name = 'World';
const command = `metalint run --name ${name}`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain(name);
});
// it('should display provided name', () => {
// const name = 'World';
// const command = `metalint run --name ${name}`;
// const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
// expect(output).to.contain(name);
// });
});
50 changes: 25 additions & 25 deletions test/commands/metalint/run.test.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import { TestContext } from '@salesforce/core/testSetup';
import { expect } from 'chai';
import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
import MetalintRun from '../../../src/commands/metalint/run.js';
// import { expect } from 'chai';
// import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
// import MetalintRun from '../../../src/commands/metalint/run.js';

describe('metalint run', () => {
const $$ = new TestContext();
let sfCommandStubs: ReturnType<typeof stubSfCommandUx>;
// let sfCommandStubs: ReturnType<typeof stubSfCommandUx>;

beforeEach(() => {
sfCommandStubs = stubSfCommandUx($$.SANDBOX);
// sfCommandStubs = stubSfCommandUx($$.SANDBOX);
});

afterEach(() => {
$$.restore();
});

it('runs hello', async () => {
await MetalintRun.run([]);
const output = sfCommandStubs.log
.getCalls()
.flatMap((c) => c.args)
.join('\n');
expect(output).to.include('hello world');
});
// it('runs hello', async () => {
// await MetalintRun.run([]);
// const output = sfCommandStubs.log
// .getCalls()
// .flatMap((c) => c.args)
// .join('\n');
// expect(output).to.include('hello world');
// });

it('runs hello with --json and no provided name', async () => {
const result = await MetalintRun.run([]);
expect(result.path).to.equal('/Users/tom.carman/dev/git/sf-metadata-linter/src/commands/metalint/run.ts');
});
// it('runs hello with --json and no provided name', async () => {
// const result = await MetalintRun.run([]);
// expect(result.path).to.equal('/Users/tom.carman/dev/git/sf-metadata-linter/src/commands/metalint/run.ts');
// });

it('runs hello world --name Astro', async () => {
await MetalintRun.run(['--name', 'Astro']);
const output = sfCommandStubs.log
.getCalls()
.flatMap((c) => c.args)
.join('\n');
expect(output).to.include('hello Astro');
});
// it('runs hello world --name Astro', async () => {
// await MetalintRun.run(['--name', 'Astro']);
// const output = sfCommandStubs.log
// .getCalls()
// .flatMap((c) => c.args)
// .join('\n');
// expect(output).to.include('hello Astro');
// });
});

0 comments on commit 6099349

Please sign in to comment.