Created
October 11, 2019 14:26
-
-
Save werne2j/160ca17341b0f26f302b85690ed08f0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import com.homeaway.devtools.jenkins.testing.JenkinsPipelineSpecification | |
class BuildJavascriptAppSpec extends JenkinsPipelineSpecification { | |
def buildJavascriptApp = null | |
def setup() { | |
buildJavascriptApp = loadPipelineScriptForTest("vars/buildJavascriptApp.groovy") | |
} | |
def "[buildJavascriptApp] will run npm publish if deploy is true"() { | |
when: | |
buildJavascriptApp deploy: true | |
then: | |
1 * getPipelineMock("sh")("npm publish") | |
} | |
def "[buildJavascriptApp] will not npm publish if deploy is false"() { | |
when: | |
buildJavascriptApp deploy: false | |
then: | |
0 * getPipelineMock("sh")("npm publish") | |
} | |
def "[buildJavascriptApp] will call closure if passed"() { | |
setup: | |
def body = Mock(Closure) | |
when: | |
buildJavascriptApp deploy: false, body | |
then: | |
1 * body() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment