Skip to content

Commit 95679fb

Browse files
committed
test(sandbox): update custom sandbox test with config initialization
Add Config initialization with accountId environment variable to properly test default data endpoint behavior when not configured. Updated the test case to include proper configuration setup that was missing in the original test implementation. test(sandbox): 更新自定义沙箱测试以包含配置初始化 添加 Config 初始化并设置 accountId 环境变量 以便在未配置时正确测试默认数据端点行为。 更新测试用例以包含适当的配置设置 这是原始测试实现中缺失的部分。 Change-Id: Ib7a3c632f6d5c669d476c4a2eccebf67b311258a Signed-off-by: OhYee <oyohyee@oyohyee.com>
1 parent 65af797 commit 95679fb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/unittests/sandbox/custom-sandbox.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,16 @@ describe('CustomSandbox', () => {
126126
});
127127

128128
it('should use default data endpoint if not configured', () => {
129+
// Set environment variable
130+
129131
const baseSandbox = {
130132
sandboxId: 'sandbox-456',
131133
} as Sandbox;
132134

133-
const customSandbox = new CustomSandbox(baseSandbox);
135+
// with env accountId=12345
136+
137+
const config = new Config({ accountId: '12345' });
138+
const customSandbox = new CustomSandbox(baseSandbox, config);
134139

135140
const baseUrl = customSandbox.getBaseUrl();
136141
expect(baseUrl).toContain('sandbox-456');

0 commit comments

Comments
 (0)