-
Notifications
You must be signed in to change notification settings - Fork 49k
test(Guardrail Node): Add Guardrail tests #21388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(Guardrail Node): Add Guardrail tests #21388
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 10 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/@n8n/nodes-langchain/nodes/Guardrails/test/helpers/model.test.ts">
<violation number="1" location="packages/@n8n/nodes-langchain/nodes/Guardrails/test/helpers/model.test.ts:105">
`runLLMValidation` now expects the input text followed by a config object, but the test still passes positional arguments. This will throw before the helper runs and makes the test fail.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| .mocked((await import('langchain/agents')).AgentExecutor) | ||
| .mockImplementation(() => mockAgentExecutor as unknown as AgentExecutor); | ||
|
|
||
| const result = await runLLMValidation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runLLMValidation now expects the input text followed by a config object, but the test still passes positional arguments. This will throw before the helper runs and makes the test fail.
Prompt for AI agents
Address the following comment on packages/@n8n/nodes-langchain/nodes/Guardrails/test/helpers/model.test.ts at line 105:
<comment>`runLLMValidation` now expects the input text followed by a config object, but the test still passes positional arguments. This will throw before the helper runs and makes the test fail.</comment>
<file context>
@@ -0,0 +1,151 @@
+ .mocked((await import('langchain/agents')).AgentExecutor)
+ .mockImplementation(() => mockAgentExecutor as unknown as AgentExecutor);
+
+ const result = await runLLMValidation(
+ 'test-guardrail',
+ mockModel,
</file context>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
|
E2E Tests: n8n tests passed after 7m 45s Run Details
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
Summary
This PR adds unit tests to the new Guardrails node
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-3797/write-tests-for-guardrail-node
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)