( context: CLITestContext, config: any, )
| 129 | * Creates a test configuration file |
| 130 | */ |
| 131 | export async function createTestConfig( |
| 132 | context: CLITestContext, |
| 133 | config: any, |
| 134 | ): Promise<string> { |
| 135 | const configPath = path.join(context.testDir, "test-config.yaml"); |
| 136 | const configContent = |
| 137 | typeof config === "string" ? config : JSON.stringify(config, null, 2); |
| 138 | |
| 139 | await fs.writeFile(configPath, configContent); |
| 140 | context.configPath = configPath; |
| 141 | |
| 142 | return configPath; |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Creates a test rule file |
no test coverage detected