Skip to content

Commit 1347aa0

Browse files
theturtle32claude
andcommitted
Add Autobahn test script to package.json
- Added npm script "test:autobahn" for running comprehensive WebSocket protocol compliance tests - Script runs the automated Autobahn test runner from test/autobahn directory - Developers can now run "npm run test:autobahn" for full protocol validation - Integrates WebSocket compliance testing into standard npm workflow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0ea2144 commit 1347aa0

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
},
4545
"scripts": {
4646
"test": "tape test/unit/*.js",
47+
"test:autobahn": "cd test/autobahn && ./run-wstest.js",
4748
"lint": "eslint lib/**/*.js test/**/*.js",
4849
"lint:fix": "eslint lib/**/*.js test/**/*.js --fix"
4950
},

test/autobahn/run-wstest.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -169,29 +169,13 @@ class AutobahnTestRunner {
169169
}
170170

171171
try {
172-
// Use the existing parseResults function but capture its output
173-
const originalConsoleLog = console.log;
174-
const originalConsoleError = console.error;
175172
const originalProcessExit = process.exit;
176-
177-
let captured = '';
178-
console.log = (...args) => {
179-
captured += args.join(' ') + '\n';
180-
originalConsoleLog(...args);
181-
};
182-
console.error = (...args) => {
183-
captured += args.join(' ') + '\n';
184-
originalConsoleError(...args);
185-
};
186-
187173
// Prevent parseResults from exiting the process
188174
process.exit = () => {};
189175

190176
parseResults();
191177

192-
// Restore original functions
193-
console.log = originalConsoleLog;
194-
console.error = originalConsoleError;
178+
// Restore original function
195179
process.exit = originalProcessExit;
196180

197181
} catch (error) {

0 commit comments

Comments
 (0)