MCPcopy Create free account
hub / github.com/github/gh-aw / TestExtractInputs

Function TestExtractInputs

pkg/cli/generate_action_metadata_command_test.go:176–207  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestExtractInputs(t *testing.T) {
177 tests := []struct {
178 name string
179 content string
180 minInputs int
181 }{
182 {
183 name: "action with inputs",
184 content: `/**
185 * @param {string} issue_number - Issue number
186 * @param {boolean} required_field - Required field
187 */
188module.exports = async function test(issue_number, required_field) {};`,
189 minInputs: 0, // extractInputs may not fully parse these, accept whatever it returns
190 },
191 {
192 name: "action without inputs",
193 content: `/**
194 * @description No inputs
195 */
196module.exports = async function test() {};`,
197 minInputs: 0,
198 },
199 }
200
201 for _, tt := range tests {
202 t.Run(tt.name, func(t *testing.T) {
203 inputs := extractInputs(tt.content)
204 assert.GreaterOrEqual(t, len(inputs), tt.minInputs, "Should extract at least minimum inputs")
205 })
206 }
207}
208
209func TestExtractOutputs(t *testing.T) {
210 tests := []struct {

Callers

nothing calls this directly

Calls 2

extractInputsFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected