-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue #100: drop support of Node.js versions older than 10.x (end…
… of life).
- Loading branch information
Showing
4 changed files
with
17 additions
and
195 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,82 +23,7 @@ class VariantComputerTest extends Specification { | |
} | ||
|
||
@Unroll | ||
def "test variant on windows version <4 (#osArch)"() { | ||
given: | ||
def project = ProjectBuilder.builder().build() | ||
|
||
props.setProperty("os.name", "Windows 8") | ||
props.setProperty("os.arch", osArch) | ||
|
||
def nodeExtension = new NodeExtension(project) | ||
nodeExtension.download.set(true) | ||
nodeExtension.version.set('5.12.0') | ||
nodeExtension.workDir.set(project.layout.projectDirectory.dir(".gradle/node")) | ||
def variantComputer = new VariantComputer() | ||
|
||
when: | ||
def computedDependency = variantComputer.computeDependency(nodeExtension) | ||
def computedNodeDir = variantComputer.computeNodeDir(nodeExtension) | ||
def computeNodeBinDir = variantComputer.computeNodeBinDir(computedNodeDir) | ||
def computedNodeExec = variantComputer.computeNodeExec(nodeExtension, computeNodeBinDir) | ||
def computedNpmScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npm") | ||
def computedNpxScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npx") | ||
|
||
then: | ||
computedDependency.get().exeDependency == exeDependency | ||
computedDependency.get().archiveDependency == 'org.nodejs:node:5.12.0:[email protected]' | ||
computedNodeDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
computeNodeBinDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
computedNodeExec.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + "node.exe") | ||
computedNpmScriptFile.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + "node_modules${PS}npm${PS}bin${PS}npm-cli.js") | ||
computedNpxScriptFile.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + "node_modules${PS}npm${PS}bin${PS}npx-cli.js") | ||
|
||
where: | ||
osArch | nodeDir | exeDependency | ||
'x86' | 'node-v5.12.0-win-x86' | 'org.nodejs:win-x86/node:5.12.0@exe' | ||
'x86_64' | 'node-v5.12.0-win-x64' | 'org.nodejs:win-x64/node:5.12.0@exe' | ||
} | ||
|
||
@Unroll | ||
def "test variant on windows version 4.+ with exe (#osArch)"() { | ||
given: | ||
def project = ProjectBuilder.builder().build() | ||
props.setProperty("os.name", "Windows 8") | ||
props.setProperty("os.arch", osArch) | ||
def nodeExtension = new NodeExtension(project) | ||
nodeExtension.download.set(true) | ||
nodeExtension.version.set('4.0.0') | ||
nodeExtension.workDir.set(project.layout.projectDirectory.dir(".gradle/node")) | ||
def variantComputer = new VariantComputer() | ||
when: | ||
def computedDependency = variantComputer.computeDependency(nodeExtension) | ||
def computedNodeDir = variantComputer.computeNodeDir(nodeExtension) | ||
def computedNodeBinDir = variantComputer.computeNodeBinDir(computedNodeDir) | ||
def computedNodeExec = variantComputer.computeNodeExec(nodeExtension, computedNodeBinDir) | ||
def computedNpmScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npm") | ||
def computedNpxScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npx") | ||
then: | ||
computedDependency.get().exeDependency == exeDependency | ||
computedDependency.get().archiveDependency == 'org.nodejs:node:4.0.0:[email protected]' | ||
computedNodeDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
computedNodeBinDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
computedNodeExec.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + "node.exe") | ||
computedNpmScriptFile.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + "node_modules${PS}npm${PS}bin${PS}npm-cli.js") | ||
computedNpxScriptFile.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + "node_modules${PS}npm${PS}bin${PS}npx-cli.js") | ||
where: | ||
osArch | nodeDir | exeDependency | ||
'x86' | 'node-v4.0.0-win-x86' | 'org.nodejs:win-x86/node:4.0.0@exe' | ||
'x86_64' | 'node-v4.0.0-win-x64' | 'org.nodejs:win-x64/node:4.0.0@exe' | ||
} | ||
@Unroll | ||
def "test variant on windows without exe (#version #osArch)"() { | ||
def "test variant on windows (#version #osArch)"() { | ||
given: | ||
def project = ProjectBuilder.builder().build() | ||
|
@@ -116,16 +41,15 @@ class VariantComputerTest extends Specification { | |
def variantComputer = new VariantComputer() | ||
|
||
when: | ||
def computedDependency = variantComputer.computeDependency(nodeExtension) | ||
def computedArchiveDependency = variantComputer.computeArchiveDependency(nodeExtension) | ||
def computedNodeDir = variantComputer.computeNodeDir(nodeExtension) | ||
def computedNodeBinDir = variantComputer.computeNodeBinDir(computedNodeDir) | ||
def computedNodeExec = variantComputer.computeNodeExec(nodeExtension, computedNodeBinDir) | ||
def computedNpmScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npm") | ||
def computedNpxScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npx") | ||
|
||
then: | ||
computedDependency.get().exeDependency == null | ||
computedDependency.get().archiveDependency == depName | ||
computedArchiveDependency.get() == depName | ||
|
||
computedNodeDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
computedNodeBinDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
|
@@ -158,16 +82,15 @@ class VariantComputerTest extends Specification { | |
def variantComputer = new VariantComputer() | ||
|
||
when: | ||
def computedDependency = variantComputer.computeDependency(nodeExtension) | ||
def computedArchiveDependency = variantComputer.computeArchiveDependency(nodeExtension) | ||
def computedNodeDir = variantComputer.computeNodeDir(nodeExtension) | ||
def computedNodeBinDir = variantComputer.computeNodeBinDir(computedNodeDir) | ||
def computedNodeExec = variantComputer.computeNodeExec(nodeExtension, computedNodeBinDir) | ||
def computedNpmScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npm") | ||
def computedNpxScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npx") | ||
|
||
then: | ||
computedDependency.get().exeDependency == null | ||
computedDependency.get().archiveDependency == depName | ||
computedArchiveDependency.get() == depName | ||
|
||
computedNodeDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
computedNodeBinDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + 'bin') | ||
|
@@ -204,16 +127,15 @@ class VariantComputerTest extends Specification { | |
def variantComputer = new VariantComputer(platformHelperSpy) | ||
when: | ||
def computedDependency = variantComputer.computeDependency(nodeExtension) | ||
def computedArchiveDependency = variantComputer.computeArchiveDependency(nodeExtension) | ||
def computedNodeDir = variantComputer.computeNodeDir(nodeExtension) | ||
def computedNodeBinDir = variantComputer.computeNodeBinDir(computedNodeDir) | ||
def computedNodeExec = variantComputer.computeNodeExec(nodeExtension, computedNodeBinDir) | ||
def computedNpmScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npm") | ||
def computedNpxScriptFile = variantComputer.computeNpmScriptFile(computedNodeDir, "npx") | ||
then: | ||
computedDependency.get().exeDependency == null | ||
computedDependency.get().archiveDependency == depName | ||
computedArchiveDependency.get() == depName | ||
computedNodeDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir) | ||
computedNodeBinDir.get().toString().endsWith(NODE_BASE_PATH + nodeDir + PS + 'bin') | ||
|