Skip to content

Commit

Permalink
Moved yarn integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sten Roger Sandvik committed Nov 29, 2016
1 parent d0131ef commit eae8a3e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.moowork.gradle.node
package com.moowork.gradle.node.itest

import com.moowork.gradle.AbstractIntegTest
import org.gradle.testkit.runner.TaskOutcome

class YarnInstall_integTest
extends AbstractIntegTest
Expand All @@ -9,7 +9,9 @@ class YarnInstall_integTest
{
given:
writeBuild( '''
apply plugin: 'com.moowork.node'
plugins {
id 'com.moowork.node'
}
node {
version = "6.9.1"
Expand All @@ -22,23 +24,25 @@ class YarnInstall_integTest
writeEmptyPackageJson()

when:
def result = runTasksSuccessfully( 'yarn' )
def result = buildTask( 'yarn' )

then:
result.wasExecuted( 'yarn' )
result.outcome == TaskOutcome.SUCCESS

when:
result = runTasksSuccessfully( 'yarn' )
result = buildTask( 'yarn' )

then:
result.wasUpToDate( 'yarn' )
result.outcome == TaskOutcome.UP_TO_DATE
}

def 'install packages with yarn in different directory'()
{
given:
writeBuild( '''
apply plugin: 'com.moowork.node'
plugins {
id 'com.moowork.node'
}
node {
version = "6.9.1"
Expand All @@ -56,9 +60,9 @@ class YarnInstall_integTest
}""" )

when:
def result = runTasksSuccessfully( 'yarn' )
def result = buildTask( 'yarn' )

then:
result.wasExecuted( 'yarn' )
result.outcome == TaskOutcome.SUCCESS
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.moowork.gradle.node
package com.moowork.gradle.node.itest

import com.moowork.gradle.AbstractIntegTest
import org.gradle.testkit.runner.TaskOutcome

class YarnRule_integTest
extends AbstractIntegTest
Expand All @@ -9,7 +9,9 @@ class YarnRule_integTest
{
given:
writeBuild( '''
apply plugin: 'com.moowork.node'
plugins {
id 'com.moowork.node'
}
node {
version = "6.9.1"
Expand All @@ -22,17 +24,19 @@ class YarnRule_integTest
writeEmptyPackageJson()

when:
def result = runTasksSuccessfully( 'yarn_install' )
def result = buildTask( 'yarn_install' )

then:
result.wasExecuted( 'yarn_install' )
result.outcome == TaskOutcome.SUCCESS
}

def 'can execute an yarn module using yarn_run_'()
{
given:
writeBuild( '''
apply plugin: 'com.moowork.node'
plugins {
id 'com.moowork.node'
}
node {
version = "6.9.1"
Expand All @@ -44,10 +48,10 @@ class YarnRule_integTest
copyResources( 'fixtures/yarn/package.json', 'package.json' )

when:
def result = runTasksSuccessfully( 'yarn_run_parent' )
def result = buildTask( 'yarn_run_parent' )

then:
result.success
result.outcome == TaskOutcome.SUCCESS
fileExists( 'child1.txt' )
fileExists( 'child2.txt' )
fileExists( 'parent1.txt' )
Expand Down

0 comments on commit eae8a3e

Please sign in to comment.