| 158 | |
| 159 | // Mock bearer token validation |
| 160 | const bearerAuthCheck = req => { |
| 161 | const auth = req.headers.authorization; |
| 162 | if (!auth || !auth.startsWith("Bearer ")) return false; |
| 163 | |
| 164 | const token = auth.slice(7); |
| 165 | const validTokens = ["token123", "token456", "secret789", "admin-token"]; |
| 166 | |
| 167 | return validTokens.includes(token); |
| 168 | }; |
| 169 | |
| 170 | suite |
| 171 | .add("Bearer Auth - Valid token", () => { |
no outgoing calls
no test coverage detected