Skip to content

Commit 8fcd5df

Browse files
Merge pull request #1574 from NativeScript/vladimirov/add-test-for-dashed-versions
Add tests for installing beta versions
2 parents 429e8a6 + f30e017 commit 8fcd5df

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/npm-installation-manager.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,27 @@ describe("Npm installation manager tests", () => {
135135
packageLatestVersion: "1.0.0",
136136
cliVersion: "1.1.0",
137137
expectedResult: "1.0.0"
138+
},
139+
140+
"when CLI's version is beta (has dash) latest matching beta version is returned": {
141+
versions: ["1.0.0", "1.0.1", "1.4.0", "1.5.0-2016-02-25-182", "1.5.0-2016-02-26-202"],
142+
packageLatestVersion: "1.4.0",
143+
cliVersion: "1.5.0-182",
144+
expectedResult: "1.5.0-2016-02-26-202"
145+
},
146+
147+
"when CLI's version is beta (has dash) latest matching official version is returned when beta versions do not match": {
148+
versions: ["1.0.0", "1.0.1", "1.4.0", "1.5.0-2016-02-25-182", "1.5.0-2016-02-26-202"],
149+
packageLatestVersion: "1.4.0",
150+
cliVersion: "1.6.0-2016-03-01-182",
151+
expectedResult: "1.4.0"
152+
},
153+
154+
"when CLI's version is beta (has dash) latest matching official version is returned when beta versions do not match (when the prerelease of CLI is higher than prerelease version of runtime)": {
155+
versions: ["1.0.0", "1.0.1", "1.4.0", "1.6.0-2016-02-25-182", "1.6.0-2016-02-26-202"],
156+
packageLatestVersion: "1.4.0",
157+
cliVersion: "1.6.0-2016-10-01-182",
158+
expectedResult: "1.4.0"
138159
}
139160
};
140161

0 commit comments

Comments
 (0)