Skip to content

Commit

Permalink
feat: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus-ssoares committed Dec 28, 2023
1 parent 38162e8 commit 370e09c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"scripts": {
"test": "cd tests && ./test.sh",
"test:yml": "cd tests && yo rn-caos ./login.yml",
"test:kmp": "cd tests && ./test-kmp.sh",
"test:kmp-yml": "cd tests && yo rn-caos ./kmp.yml",
"lint": "eslint './generators'"
},
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package br.com.stone.ton.kmp.plugins

import br.com.stone.ton.StoneCo
import co.stone.banking.cards.common.CardsPlugin
import co.stone.multiplatform.core.featurePlugin.MultiplatformFeature

internal fun installCards() {
MultiplatformFeature.install(
CardsPlugin()
)
}
19 changes: 19 additions & 0 deletions tests/ios/kmp/kmpFeatures/Cards.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//

import KotlinShared
import FeatureCards

class CardsKmpFeature {

func get() -> KotlinCoordinator? {
guard let featurePlugin: CardsPlugin = MultiplatformFeature.plugin(Cards.self) else { return nil }
let coordinator = featurePlugin.platform.entrypoint(KotlinUnit.shared)
return coordinator
}

func install() {
MultiplatformFeature.shared.install(
CardsPlugin()
)
}
}
2 changes: 2 additions & 0 deletions tests/kmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
featureName: 'FeatureMassa'
featurePluginName: 'FeatureMassPlugin'
22 changes: 22 additions & 0 deletions tests/test-kmp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/expect

spawn rm -rf android/
spawn rm -rf ios/
interact

spawn yo rn-caos:kmp

expect "Qual o nome de sua feature?"
send "Dda"

expect "Qual o nome do Plugin de sua feature?"
send "DdaPlugin"

expect eof

spawn rm -rf android/
spawn rm -rf ios/

spawn yo rn-caos ./login.yml

expect eof

0 comments on commit 370e09c

Please sign in to comment.