(snippet: string, stdin: string = '')
| 39 | // Invoke a bash snippet that sources the lib and runs something against it. |
| 40 | // Returns stdout + stderr + exit code. Stdin is piped so [ -t 0 ] = false. |
| 41 | function runLibSnippet(snippet: string, stdin: string = '') { |
| 42 | const script = `set -euo pipefail\n. ${JSON.stringify(LIB)}\n${snippet}`; |
| 43 | const res = spawnSync('bash', ['-c', script], { |
| 44 | input: stdin, |
| 45 | encoding: 'utf-8', |
| 46 | }); |
| 47 | return { |
| 48 | stdout: (res.stdout || '').trim(), |
| 49 | stderr: (res.stderr || '').trim(), |
| 50 | status: res.status ?? -1, |
| 51 | }; |
| 52 | } |
| 53 | |
| 54 | describe('gstack-gbrain-supabase-verify', () => { |
| 55 | const VALID = |
no test coverage detected