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
11 changes: 11 additions & 0 deletions packages/test/src/test-ephemeral-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,14 @@ test("TestEnvironment doesn't hang on fail to download", async (t) => {
t.pass();
}
});

test('TestEnvironment.createLocal correctly populates address', async (t) => {
const testEnv = await RealTestWorkflowEnvironment.createLocal();
t.teardown(() => testEnv.teardown());
await t.notThrowsAsync(async () => {
await Connection.connect({
address: testEnv.address,
connectTimeout: 500,
});
}, 'should be able to connect to test server');
});
17 changes: 15 additions & 2 deletions packages/testing/src/testing-workflow-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export class TestWorkflowEnvironment {
protected readonly server: native.EphemeralServer | 'existing',
connection: Connection,
nativeConnection: NativeConnection,
namespace: string | undefined
namespace: string | undefined,
/**
* Address used when constructing `connection` and `nativeConnection`
*/
public readonly address: string
) {
this.connection = connection;
this.nativeConnection = nativeConnection;
Expand Down Expand Up @@ -238,7 +242,16 @@ export class TestWorkflowEnvironment {
[InternalConnectionOptionsSymbol]: { supportsTestService: supportsTimeSkipping },
});

return new this(runtime, optsWithDefaults, supportsTimeSkipping, server, connection, nativeConnection, namespace);
return new this(
runtime,
optsWithDefaults,
supportsTimeSkipping,
server,
connection,
nativeConnection,
namespace,
address
);
}

/**
Expand Down