Skip to content

Commit ba999df

Browse files
committed
test: stabilize live assemblies get e2e
1 parent 1a31bff commit ba999df

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

packages/node/test/e2e/cli/assemblies.test.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ import type { OutputEntry } from './test-utils.ts'
77
import { hasTransloaditCredentials, testCase } from './test-utils.ts'
88

99
const describeLive = hasTransloaditCredentials ? describe : describe.skip
10+
const volatileNotifyFields = [
11+
'notify_start',
12+
'notify_status',
13+
'notify_response_code',
14+
'notify_response_data',
15+
'notify_duration',
16+
] as const
17+
18+
function normalizeAssemblyForAssertion<T extends Record<string, unknown>>(assembly: T): T {
19+
const normalized = { ...assembly }
20+
for (const field of volatileNotifyFields) {
21+
delete normalized[field]
22+
}
23+
24+
return normalized
25+
}
1026

1127
describeLive('assemblies', () => {
1228
describe('get', () => {
@@ -35,7 +51,9 @@ describeLive('assemblies', () => {
3551
for (const [expectation, actual] of zip(expectations, actuals)) {
3652
expect(actual).to.have.lengthOf(1)
3753
expect(actual).to.have.nested.property('[0].type').that.equals('print')
38-
expect(actual).to.have.nested.property('[0].json').that.deep.equals(expectation)
54+
expect(normalizeAssemblyForAssertion(actual[0].json ?? {})).to.deep.equal(
55+
normalizeAssemblyForAssertion(expectation),
56+
)
3957
}
4058
}),
4159
)

0 commit comments

Comments
 (0)