Skip to content

Commit

Permalink
move servePath
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed Feb 26, 2024
1 parent 4e6ee73 commit 619a0da
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
5 changes: 0 additions & 5 deletions inngest-core/src/main/kotlin/com/inngest/Environment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ object Environment {
}
}

fun inngestServePath(path: String? = null): String? {
if (path != null) return path
return System.getenv(InngestSystem.ServePath.value)
}

fun inngestEnv(
env: String? = null,
isDev: Boolean? = null,
Expand Down
15 changes: 0 additions & 15 deletions inngest-core/src/test/kotlin/com/inngest/EnvironmentTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ internal class EnvironmentTest {
// @Test
// fun `test inngestEventApiBaseUrl with INNGEST_BASE_URL value`() { }

// Serve Path
@Test
fun `test inngestServePath`() {
assertNull(Environment.inngestServePath())
}

@Test
fun `test inngestServePath with path value`() {
val path = "/api/inngest"
assertEquals(path, Environment.inngestServePath(path))
}

// @Test
// fun `test inngestServePath with INNGEST_SERVE_PATH value`() {}

// Env
@Test
fun `test inngestEnv with no params`() {
Expand Down
16 changes: 16 additions & 0 deletions inngest-core/src/test/kotlin/com/inngest/ServeConfigTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,21 @@ internal class ServeConfigTest {
// fun `should return INNGEST_SERVE_ORIGIN value`() {}

// servePath()
@Test
fun `should return null - servePath`() {
val config = ServeConfig(client = client)
assertNull(config.servePath())
}

@Test
fun `should return passed in value - servePath`() {
val path = "/api/inngest"
val config = ServeConfig(client = client, servePath = path)
assertEquals(path, config.servePath())
}

// @Test
// fun `should return INNGEST_SERVE_PATH value`() {}

// logLevel()
}

0 comments on commit 619a0da

Please sign in to comment.