(t *testing.T)
| 207 | } |
| 208 | |
| 209 | func 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 | */ |
| 221 | module.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 | |
| 243 | func TestExtractDependencies(t *testing.T) { |
| 244 | tests := []struct { |
nothing calls this directly
no test coverage detected