Skip to content

Commit b5f49cd

Browse files
committed
test: add e2e test
1 parent c1d3f71 commit b5f49cd

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "com.mixed.package",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
"com.some.package": "1.0.0",
6+
"dev.comradevanti.opt-unity": "3.5.0",
7+
"com.unity.ugui": "1.0.0"
8+
}
9+
}

test/e2e/deps.test.ts

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { prepareHomeDirectory } from "./setup/directories";
2-
import { runOpenupm } from "./run";
31
import { ResultCodes } from "../../src/cli/result-codes";
2+
import { openupmRegistryUrl } from "../../src/domain/registry-url";
3+
import { runOpenupm } from "./run";
4+
import { prepareHomeDirectory } from "./setup/directories";
5+
import { e2eTestRegistryUrl } from "./setup/test-registry";
46

57
describe("print package dependencies", () => {
68
it("should print dependencies for an openupm package with version", async () => {
@@ -38,6 +40,27 @@ describe("print package dependencies", () => {
3840
);
3941
});
4042

43+
it("should print dependencies for package with mix of 3rd party, openupm and unity dependencies", async () => {
44+
const homeDir = await prepareHomeDirectory();
45+
46+
const output = await runOpenupm(homeDir, [
47+
"deps",
48+
"com.mixed.package@1.0.0",
49+
"--registry",
50+
e2eTestRegistryUrl,
51+
openupmRegistryUrl,
52+
]);
53+
54+
expect(output.code).toEqual(ResultCodes.Ok);
55+
expect(output.stdErr).toEqual(
56+
expect.arrayContaining([
57+
expect.stringContaining("com.some.package@1.0.0"),
58+
expect.stringContaining("dev.comradevanti.opt-unity@3.5.0"),
59+
expect.stringContaining("com.unity.ugui@1.0.0"),
60+
])
61+
);
62+
});
63+
4164
it("should print built-in dependencies", async () => {
4265
// See https://github.com/openupm/openupm-cli/issues/133
4366
const homeDir = await prepareHomeDirectory();

0 commit comments

Comments
 (0)