(options: { connectionString: string })
| 31 | } |
| 32 | |
| 33 | export async function tearDownCockroach(options: { connectionString: string }) { |
| 34 | const { connectionString } = options |
| 35 | const credentials = uriToCredentials(connectionString) |
| 36 | const credentialsClone = { ...credentials } |
| 37 | credentialsClone.database = 'cockroachdb' |
| 38 | credentialsClone.schema = '' |
| 39 | const connectionStringCopy = credentialsToUri(credentialsClone) |
| 40 | |
| 41 | const db = new Client({ |
| 42 | connectionString: connectionStringCopy, |
| 43 | }) |
| 44 | |
| 45 | await db.connect() |
| 46 | await db.query(` |
| 47 | DROP DATABASE IF EXISTS "${credentials.database}"; |
| 48 | `) |
| 49 | await db.end() |
| 50 | } |
no test coverage detected