Skip to content

Instantly share code, notes, and snippets.

View mantovanirian's full-sized avatar

Rian Putra Mantovani mantovanirian

View GitHub Profile
func testErrorAndThenSucceed() {
let divisor = DivisorMock()
let vm = ViewModel(divisor: divisor.divide)
vm.load()
// nah ini kan gagal hit pertama
// ini ga perlu dites kan?
vm.load()
trainer --path ${path_to_xctestrun_or_TestSummaries.plist}
@mantovanirian
mantovanirian / xcodebuild.sh
Created November 13, 2019 07:42
Shell Script
xcodebuild test-without-building -xctestrun ${xctestrunfile}
-derivedDataPath ${testResultDerivedData}
-destination 'platform=iOS Simulator,name=${preferred phone}'
-only-testing:"${bundle test}"
@mantovanirian
mantovanirian / Fastfile
Created November 13, 2019 03:41
Fastfile
lane :build_for_test do
cocoapods(repo_update: true)
scan(
workspace: "your.xcworkspace",
scheme: "your_scheme",
should_zip_build_products: true,
build_for_testing: true,
device: "your_preferred_device
)
end
@mantovanirian
mantovanirian / fbsimctl-node-simctl.js
Created June 10, 2017 14:48
fbsimctl function on node-simctl
async function simCommand (command:string, timeout:number, args:Array = [], env = {}, executingFunction = exec) {
// run a particular simctl command
args = [command, ...args];
// Prefix all passed in environment variables with 'SIMCTL_CHILD_', simctl
// will then pass these to the child (spawned) process.
env = _.defaults(_.mapKeys(env, function(value, key) {
return `SIMCTL_CHILD_${key}`;
}), process.env);
try {