Skip to content

Commit ca6aaa2

Browse files
committed
test: debugging failed tests
1 parent 221587b commit ca6aaa2

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.github/workflows/release_please.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ permissions:
99
contents: write
1010
pull-requests: write
1111
id-token: write
12+
issues: write
1213

1314
jobs:
1415
release-please:

test/commands/start.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Codex } from '@codex-storage/sdk-js'
2-
import { runCommand } from '@oclif/test'
2+
import { runCommand as runCommandRaw } from '@oclif/test'
33
import { use as chaiUse, expect } from 'chai'
44
import chaiAsPromised from 'chai-as-promised'
55
import Dockerode from 'dockerode'
@@ -12,6 +12,17 @@ import { deleteNetwork, findContainer } from '../utils/docker'
1212
chaiUse(chaiAsPromised)
1313
let testFailed = false
1414

15+
async function runCommand(args: string): Promise<ReturnType<typeof runCommandRaw>> {
16+
const result = await runCommandRaw(args)
17+
18+
if (result.error) {
19+
console.log(result.stdout)
20+
console.error(result.stderr)
21+
}
22+
23+
return result
24+
}
25+
1526
function wrapper (fn: () => Promise<unknown>): () => Promise<unknown> {
1627
return async () => {
1728
try {

test/commands/stop.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { runCommand } from '@oclif/test'
1+
import { runCommand as runCommandRaw } from '@oclif/test'
22
import { use as chaiUse, expect } from 'chai'
33
import chaiAsPromised from 'chai-as-promised'
44
import Dockerode from 'dockerode'
@@ -9,6 +9,17 @@ import { deleteNetwork, findContainer } from '../utils/docker'
99

1010
chaiUse(chaiAsPromised)
1111

12+
async function runCommand(args: string): Promise<ReturnType<typeof runCommandRaw>> {
13+
const result = await runCommandRaw(args)
14+
15+
if (result.error) {
16+
console.log(result.stdout)
17+
console.error(result.stderr)
18+
}
19+
20+
return result
21+
}
22+
1223
describe('stop command', () => {
1324
let docker: Dockerode
1425
const envPrefix = `codex-factory-test-${randomBytes(4).toString('hex')}`

0 commit comments

Comments
 (0)