Skip to content
Draft
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
8 changes: 8 additions & 0 deletions src/__mocks__/utils.moduleResolver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Mock implementation of utils.moduleResolver for Jest tests
* This avoids import.meta.resolve compatibility issues in test environment
*/

export const resolveModule = jest.fn((modulePath: string): string =>
// Default mock behavior - can be overridden in individual tests
`file://${modulePath}`);
312 changes: 312 additions & 0 deletions src/__tests__/__snapshots__/server.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ exports[`runServer should attempt to run server, use default tools: console 1`]
[
"Registered tool: componentSchemas",
],
[
"Registered tool: getAvailableModules",
],
[
"Registered tool: getComponentSourceCode",
],
[
"Registered tool: getReactUtilityClasses",
],
],
"log": [
[
Expand Down Expand Up @@ -678,6 +687,309 @@ exports[`runServer should attempt to run server, use default tools: console 1`]
},
[Function],
],
[
"getAvailableModules",
{
"description": "Retrieves a list of available Patternfly react-core modules in the current environment.",
"inputSchema": {
"packageName": ZodDefault {
"_def": {
"defaultValue": [Function],
"description": "Name of the patternfly package to get modules for. For tables its always better to use the @patternfly/react-data-view package.",
"errorMap": [Function],
"innerType": ZodEnum {
"_def": {
"description": "Name of the patternfly package to get modules for. For tables its always better to use the @patternfly/react-data-view package.",
"typeName": "ZodEnum",
"values": [
"@patternfly/react-core",
"@patternfly/react-icons",
"@patternfly/react-table",
"@patternfly/react-data-view",
"@patternfly/react-component-groups",
],
},
"and": [Function],
"array": [Function],
"brand": [Function],
"catch": [Function],
"default": [Function],
"describe": [Function],
"isNullable": [Function],
"isOptional": [Function],
"nullable": [Function],
"nullish": [Function],
"optional": [Function],
"or": [Function],
"parse": [Function],
"parseAsync": [Function],
"pipe": [Function],
"promise": [Function],
"readonly": [Function],
"refine": [Function],
"refinement": [Function],
"safeParse": [Function],
"safeParseAsync": [Function],
"spa": [Function],
"superRefine": [Function],
"transform": [Function],
"~standard": {
"validate": [Function],
"vendor": "zod",
"version": 1,
},
},
"typeName": "ZodDefault",
},
"and": [Function],
"array": [Function],
"brand": [Function],
"catch": [Function],
"default": [Function],
"describe": [Function],
"isNullable": [Function],
"isOptional": [Function],
"nullable": [Function],
"nullish": [Function],
"optional": [Function],
"or": [Function],
"parse": [Function],
"parseAsync": [Function],
"pipe": [Function],
"promise": [Function],
"readonly": [Function],
"refine": [Function],
"refinement": [Function],
"safeParse": [Function],
"safeParseAsync": [Function],
"spa": [Function],
"superRefine": [Function],
"transform": [Function],
"~standard": {
"validate": [Function],
"vendor": "zod",
"version": 1,
},
},
},
},
[Function],
],
[
"getComponentSourceCode",
{
"description": "Retrieve a source code of a specified Patternfly react-core module in the current environment.",
"inputSchema": {
"componentName": ZodString {
"_def": {
"checks": [],
"coerce": false,
"description": "Name of the PatternFly component (e.g., "Button", "Table")",
"typeName": "ZodString",
},
"and": [Function],
"array": [Function],
"brand": [Function],
"catch": [Function],
"default": [Function],
"describe": [Function],
"isNullable": [Function],
"isOptional": [Function],
"nullable": [Function],
"nullish": [Function],
"optional": [Function],
"or": [Function],
"parse": [Function],
"parseAsync": [Function],
"pipe": [Function],
"promise": [Function],
"readonly": [Function],
"refine": [Function],
"refinement": [Function],
"safeParse": [Function],
"safeParseAsync": [Function],
"spa": [Function],
"superRefine": [Function],
"transform": [Function],
"~standard": {
"validate": [Function],
"vendor": "zod",
"version": 1,
},
},
"packageName": ZodDefault {
"_def": {
"defaultValue": [Function],
"description": "Name of the patternfly package to get component from. For tables its always better to use the @patternfly/react-data-view package.",
"errorMap": [Function],
"innerType": ZodOptional {
"_def": {
"description": "Name of the patternfly package to get component from. For tables its always better to use the @patternfly/react-data-view package.",
"errorMap": [Function],
"innerType": ZodEnum {
"_def": {
"typeName": "ZodEnum",
"values": [
"@patternfly/react-core",
"@patternfly/react-table",
"@patternfly/react-data-view",
"@patternfly/react-component-groups",
],
},
"and": [Function],
"array": [Function],
"brand": [Function],
"catch": [Function],
"default": [Function],
"describe": [Function],
"isNullable": [Function],
"isOptional": [Function],
"nullable": [Function],
"nullish": [Function],
"optional": [Function],
"or": [Function],
"parse": [Function],
"parseAsync": [Function],
"pipe": [Function],
"promise": [Function],
"readonly": [Function],
"refine": [Function],
"refinement": [Function],
"safeParse": [Function],
"safeParseAsync": [Function],
"spa": [Function],
"superRefine": [Function],
"transform": [Function],
"~standard": {
"validate": [Function],
"vendor": "zod",
"version": 1,
},
},
"typeName": "ZodOptional",
},
"and": [Function],
"array": [Function],
"brand": [Function],
"catch": [Function],
"default": [Function],
"describe": [Function],
"isNullable": [Function],
"isOptional": [Function],
"nullable": [Function],
"nullish": [Function],
"optional": [Function],
"or": [Function],
"parse": [Function],
"parseAsync": [Function],
"pipe": [Function],
"promise": [Function],
"readonly": [Function],
"refine": [Function],
"refinement": [Function],
"safeParse": [Function],
"safeParseAsync": [Function],
"spa": [Function],
"superRefine": [Function],
"transform": [Function],
"~standard": {
"validate": [Function],
"vendor": "zod",
"version": 1,
},
},
"typeName": "ZodDefault",
},
"and": [Function],
"array": [Function],
"brand": [Function],
"catch": [Function],
"default": [Function],
"describe": [Function],
"isNullable": [Function],
"isOptional": [Function],
"nullable": [Function],
"nullish": [Function],
"optional": [Function],
"or": [Function],
"parse": [Function],
"parseAsync": [Function],
"pipe": [Function],
"promise": [Function],
"readonly": [Function],
"refine": [Function],
"refinement": [Function],
"safeParse": [Function],
"safeParseAsync": [Function],
"spa": [Function],
"superRefine": [Function],
"transform": [Function],
"~standard": {
"validate": [Function],
"vendor": "zod",
"version": 1,
},
},
},
},
[Function],
],
[
"getReactUtilityClasses",
{
"description": "Retrieves a list of available Patternfly react-styles utility classes in the current environment.",
"inputSchema": {
"utilityName": ZodEnum {
"_def": {
"description": "Name of a set of utility classes to retrieve from @patternfly/react-styles.",
"typeName": "ZodEnum",
"values": [
"Accessibility",
"Alignment",
"BackgroundColor",
"BoxShadow",
"Display",
"Flex",
"Float",
"Sizing",
"Spacing",
"Text",
],
},
"and": [Function],
"array": [Function],
"brand": [Function],
"catch": [Function],
"default": [Function],
"describe": [Function],
"isNullable": [Function],
"isOptional": [Function],
"nullable": [Function],
"nullish": [Function],
"optional": [Function],
"or": [Function],
"parse": [Function],
"parseAsync": [Function],
"pipe": [Function],
"promise": [Function],
"readonly": [Function],
"refine": [Function],
"refinement": [Function],
"safeParse": [Function],
"safeParseAsync": [Function],
"spa": [Function],
"superRefine": [Function],
"transform": [Function],
"~standard": {
"validate": [Function],
"vendor": "zod",
"version": 1,
},
},
},
},
[Function],
],
],
}
`;
Loading
Loading