Skip to content

Instantly share code, notes, and snippets.

@whysoserious
Last active December 19, 2018 16:12
Show Gist options
  • Save whysoserious/14c09e68a10b8c619330 to your computer and use it in GitHub Desktop.
Save whysoserious/14c09e68a10b8c619330 to your computer and use it in GitHub Desktop.
Running SBT tasks before and after tests
object MyProject {
val projectSettings = inConfig(Test)(
testOptions += Tests.Setup { _ =>
// add your initialization code here eg.:
(runMain in Compile in OtherSubproject).toTask(" b.c.d.CustomMainFunction args").value
}
testOptions += Tests.Cleanup { _ =>
// add your clean up code here
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment