Skip to content

Commit a061014

Browse files
committed
hiding test database a little bit
1 parent da5c93a commit a061014

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

build.gradle.kts

+4-8
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,15 @@ kotlin {
9090
val jsTest by getting {
9191
sqldelight {
9292
databases {
93-
create("Database") {
94-
packageName.set("com.example")
93+
create("TestDatabaseDontUse") {
94+
packageName.set("cz.sazel.sqldelight._dont_use")
9595
generateAsync.set(true)
96-
9796
}
9897
}
9998
}
10099
}
101100

102-
val publicationsFromMainHost =
103-
listOf(js()).map { it.name } + "kotlinMultiplatform"
101+
val publicationsFromMainHost = listOf(js()).map { it.name } + "kotlinMultiplatform"
104102

105103
dokka {
106104
moduleName = "node-sqlite3-driver"
@@ -124,8 +122,7 @@ kotlin {
124122
publications {
125123
matching { it.name in publicationsFromMainHost }.all {
126124
val targetPublication = this@all
127-
tasks.withType<AbstractPublishToMaven>()
128-
.matching { it.publication == targetPublication }
125+
tasks.withType<AbstractPublishToMaven>().matching { it.publication == targetPublication }
129126
.configureEach { onlyIf { findProperty("isMainHost") == "true" } }
130127
}
131128

@@ -235,4 +232,3 @@ detekt {
235232
html.required.set(true) // observe findings in your browser with structure and code snippets
236233
}
237234
}
238-

src/jsTest/kotlin/cz/sazel/sqldelight/node/sqlite3/DriverWithLibraryTest.kt

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
package cz.sazel.sqldelight.node.sqlite3
22

3-
import com.example.Database
4-
import com.example.HockeyPlayer
3+
import cz.sazel.sqldelight.dontuse.HockeyPlayer
4+
import cz.sazel.sqldelight.dontuse.TestDataBaseDontUseQueries
55
import kotlinx.coroutines.flow.take
66
import kotlinx.coroutines.flow.toCollection
77
import kotlinx.coroutines.test.runTest
88
import kotlin.test.Test
99
import kotlin.test.assertContains
1010
import kotlin.test.assertEquals
1111

12+
typealias Database = cz.sazel.sqldelight._dont_use.TestDatabaseDontUse
13+
1214
class DriverWithLibraryTest {
1315

1416
private lateinit var driver: SQLite3Driver
17+
private lateinit var playerQueries: TestDataBaseDontUseQueries
1518
private val dbName = "driver_test.db"
1619

1720
private fun withDatabase(fn: suspend Database.() -> Unit) = runTest {
@@ -20,6 +23,7 @@ class DriverWithLibraryTest {
2023
try {
2124
driver = initSqlite3SqlDriver(filename = "driver_test.db", schema = Database.Schema)
2225
val database = Database(driver)
26+
playerQueries = database.testDataBaseDontUseQueries
2327
database.fn()
2428
} finally {
2529
js("require('fs').unlinkSync(dbName)")
@@ -121,4 +125,4 @@ class DriverWithLibraryTest {
121125
private companion object {
122126
val initialPlayer = HockeyPlayer(player_number = 15, full_name = "Ryan Getzlaf")
123127
}
124-
}
128+
}

0 commit comments

Comments
 (0)