Skip to content

Commit

Permalink
test: add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeVanti committed Nov 1, 2024
1 parent c0fb1e8 commit 90bd2ab
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/verdaccio/com.mixed.package/v1.0.0/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "com.mixed.package",
"version": "1.0.0",
"dependencies": {
"com.some.package": "1.0.0",
"dev.comradevanti.opt-unity": "3.5.0",
"com.unity.ugui": "1.0.0"
}
}
27 changes: 25 additions & 2 deletions test/e2e/deps.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { prepareHomeDirectory } from "./setup/directories";
import { runOpenupm } from "./run";
import { ResultCodes } from "../../src/cli/result-codes";
import { openupmRegistryUrl } from "../../src/domain/registry-url";
import { runOpenupm } from "./run";
import { prepareHomeDirectory } from "./setup/directories";
import { e2eTestRegistryUrl } from "./setup/test-registry";

describe("print package dependencies", () => {
it("should print dependencies for an openupm package with version", async () => {
Expand Down Expand Up @@ -38,6 +40,27 @@ describe("print package dependencies", () => {
);
});

it("should print dependencies for package with mix of 3rd party, openupm and unity dependencies", async () => {
const homeDir = await prepareHomeDirectory();

const output = await runOpenupm(homeDir, [
"deps",
"com.mixed.package@1.0.0",
"--registry",
e2eTestRegistryUrl,
openupmRegistryUrl,
]);

expect(output.code).toEqual(ResultCodes.Ok);
expect(output.stdErr).toEqual(
expect.arrayContaining([
expect.stringContaining("com.some.package@1.0.0"),
expect.stringContaining("dev.comradevanti.opt-unity@3.5.0"),
expect.stringContaining("com.unity.ugui@1.0.0"),
])
);
});

it("should print built-in dependencies", async () => {
// See https://github.com/openupm/openupm-cli/issues/133
const homeDir = await prepareHomeDirectory();
Expand Down

0 comments on commit 90bd2ab

Please sign in to comment.