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

Function TestExtractOutputs

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

Source from the content-addressed store, hash-verified

207}
208
209func TestExtractOutputs(t *testing.T) {
210 tests := []struct {
211 name string
212 content string
213 minOutputs int
214 }{
215 {
216 name: "action with outputs",
217 content: `/**
218 * @returns {Object} Result object
219 * @property {string} output1 - First output
220 */
221module.exports = async function test() {
222 return { output1: 'value' };
223};`,
224 minOutputs: 0, // extractOutputs may not fully parse these, accept whatever it returns
225 },
226 {
227 name: "action without outputs",
228 content: `module.exports = async function test() {
229 console.log('test');
230};`,
231 minOutputs: 0,
232 },
233 }
234
235 for _, tt := range tests {
236 t.Run(tt.name, func(t *testing.T) {
237 outputs := extractOutputs(tt.content)
238 assert.GreaterOrEqual(t, len(outputs), tt.minOutputs, "Should extract at least minimum outputs")
239 })
240 }
241}
242
243func TestExtractDependencies(t *testing.T) {
244 tests := []struct {

Callers

nothing calls this directly

Calls 2

extractOutputsFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected