forked from InsertKoinIO/koin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
024b7fe
commit deed4db
Showing
10 changed files
with
284 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
koin-projects/docs/reference/koin-test/checkmodules_plugin.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
## Checking your modules with Koin Gradle Plugin | ||
|
||
The Koin gradle plugin allow you to run `checkModules` task to run your modules verification. | ||
|
||
### Gradle plugin | ||
|
||
First, setup the Gradle plugin: | ||
|
||
```groovy | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath "org.koin:koin-gradle-plugin:$koin_version" | ||
} | ||
} | ||
apply plugin: 'koin' | ||
``` | ||
|
||
### The JUnit CheckModules test | ||
|
||
You need to add a JUnit catgeory to let us run your checkModules tests: `@Category(CheckModuleTest::class)` | ||
|
||
Each of the module test will use the `checkModules` API to check the module: | ||
|
||
```kotlin | ||
@Category(CheckModuleTest::class) | ||
class CheckModulesTest : KoinTest { | ||
|
||
@Test | ||
fun checkAllModules() = checkModules { | ||
modules(appModule) | ||
} | ||
} | ||
``` | ||
|
||
### Verify your modules | ||
|
||
Once done, you can verify your modules: | ||
|
||
``` | ||
./gradlew checkModules | ||
``` | ||
|
||
You can also verify your modules in a continuous way: | ||
|
||
``` | ||
./gradlew checkModules --continuous | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.