(t *testing.T)
| 174 | } |
| 175 | |
| 176 | func 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 | */ |
| 188 | module.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 | */ |
| 196 | module.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 | |
| 209 | func TestExtractOutputs(t *testing.T) { |
| 210 | tests := []struct { |
nothing calls this directly
no test coverage detected