From 51a1d1b034cd6fce9badd0ee962db143b12045db Mon Sep 17 00:00:00 2001 From: Alexzhu Date: Tue, 2 Jun 2026 08:19:19 +0800 Subject: [PATCH] test(scripts): run OpenClaw formatter tests without vitest (#3063) Co-authored-by: Steven Enamakel --- .../__tests__/openClaw-formatter.test.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/tools-generator/__tests__/openClaw-formatter.test.js b/scripts/tools-generator/__tests__/openClaw-formatter.test.js index 021ecdbbe..f566a72a5 100644 --- a/scripts/tools-generator/__tests__/openClaw-formatter.test.js +++ b/scripts/tools-generator/__tests__/openClaw-formatter.test.js @@ -2,7 +2,8 @@ * Unit tests for the OpenClaw formatter. * Tests markdown generation, tool formatting, and categorization. */ -import { describe, expect, it } from 'vitest'; +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; import { ENVIRONMENTS, @@ -13,6 +14,21 @@ import { TOOL_CATEGORIES, } from '../openClaw-formatter.js'; +const expect = (actual) => ({ + toBe(expected) { + assert.equal(actual, expected); + }, + toContain(expected) { + assert.ok(actual.includes(expected), `Expected value to include: ${expected}`); + }, + toHaveLength(expected) { + assert.equal(actual.length, expected); + }, + toHaveProperty(expected) { + assert.ok(Object.hasOwn(actual, expected), `Expected object to include property: ${expected}`); + }, +}); + describe('OpenClaw Formatter', () => { describe('formatParameters', () => { it('should format parameters correctly', () => {