alt/apps/client/test_runtime/socket_web_runtime_smoke_test.dart
toki f762d2abd9 feat: worker persistence layer and socket session updates
- Add worker storage layer with PostgreSQL/sqlc setup
- Add migration files for worker backbone schema
- Add job runner and built-in jobs implementation
- Add Redis key definitions for worker state management
- Archive socket-session-loop milestone (completed/renamed)
- Update roadmap current.md and foundation-alignment phase
- Add socket endpoint integration and runtime smoke tests
- Add infra-check, worker-storage-check, worker-storage-gen CLI tools
- Update API socket server and config
- Add pubspec dependencies and client socket endpoint changes
- Add config tests for API and worker services
2026-05-28 19:05:10 +09:00

39 lines
1.2 KiB
Dart

// ignore_for_file: depend_on_referenced_packages
@TestOn('browser')
library;
import 'package:test/test.dart';
import 'package:alt_client/src/integrations/socket/alt_socket_client.dart';
import 'package:alt_client/src/integrations/socket/socket_endpoint.dart';
void main() {
test(
'connects from Chrome runtime to ALT API and completes hello handshake',
() async {
const endpoint = AltSocketEndpoint(
host: String.fromEnvironment(
'ALT_SOCKET_HOST',
defaultValue: '127.0.0.1',
),
port: int.fromEnvironment('ALT_SOCKET_PORT', defaultValue: 13000),
path: String.fromEnvironment(
'ALT_SOCKET_PATH',
defaultValue: '/socket',
),
);
final client = await AltSocketClient.connect(endpoint);
addTearDown(client.close);
final response = await client.hello(timeout: const Duration(seconds: 5));
expect(response.serverName, equals('alt-api'));
expect(response.serverVersion, equals('dev'));
expect(response.altProtocolVersion, equals('alt.v1'));
expect(response.capabilities, contains('hello'));
expect(response.capabilities, contains('request-response'));
},
);
}