Hello, I have a question. I’m currently working on...
# ktor
a
Hello, I have a question. I’m currently working on a project, and I want to write a test to assure that there are no duplicated endpoints between the modules in my application, reason being is that I’m trying to move some parts of a module into a new module. It seems that the
getAllRoutes()
function doesn’t account for duplicate routes (It ignores duplicates and only gets it as one). As a result, I’m seeking guidance on potential workarounds to write this test. Sorry for bothering, any assistance would be appreciated!!
Btw, this is how I’m trying to test
a
The
getAllRoutes
function should return all routes. What do you mean by duplicated endpoints?
The
getAllRoutes
works as expected but when you add a route with an existing selector it doesn't get appended. So in the runtime, there are no routes with the duplicated selectors.
👀 1
👍 1
thank you color 1
a
I see, so it’s impossible to write this test. Thank you so much for the response!!
j
You’re only option relies in static analyzing. You could create a custom rule with Ktlint: https://medium.com/@vanniktech/writing-your-first-ktlint-rule-5a1707f4ca5b
👀 1
a
I was able to workaround and write the test I wanted as follows! (Just have to repeat for every module and test for duplicates)
j
congrats then 😁
thank you color 1
❤️ 1
d