Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 1 addition & 35 deletions e2e-tests/plugin-dev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
log,
logSection,
runCommand,
RunCommandOptions,
runExpectingFailure,
} from './support/plugin-export-build';
Comment thread
gashcrumb marked this conversation as resolved.
import {
cleanupCompose,
Expand All @@ -33,40 +33,6 @@ const availableTools = detectAvailableComposeToolsSync();
const describeWithCompose =
availableTools.length > 0 ? describe : describe.skip;

async function runExpectingFailure(
command: string,
options: RunCommandOptions = {},
): Promise<{ stdout: string; stderr: string; message: string }> {
let succeeded = false;
let stdout = '';
let caughtError: unknown;

try {
const res = await runCommand(command, options);
succeeded = true;
stdout = res.stdout;
} catch (err: unknown) {
caughtError = err;
}

if (succeeded) {
throw new Error(
`Command expected to fail, but succeeded with output: ${stdout}`,
);
}

const e = (caughtError || {}) as {
stdout?: string;
stderr?: string;
message?: string;
};
return {
stdout: e?.stdout || '',
stderr: e?.stderr || '',
message: e?.message || '',
};
}

describe('plugin dev', () => {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'rhdh-cli-plugin-dev-'));
const pluginDir = path.join(tmpDir, 'test-frontend-plugin');
Expand Down
Loading
Loading