Skip to content

Commit

Permalink
fix: avoid importing from test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Feb 27, 2024
1 parent cada1d7 commit 54e34cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/registry-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { UnityPackument } from "./types/packument";
import { DomainName, isInternalPackage } from "./types/domain-name";
import { isSemanticVersion, SemanticVersion } from "./types/semantic-version";
import { packageReference } from "./types/package-reference";
import { RegistryUrl } from "./types/registry-url";
import { RegistryUrl, unityRegistryUrl } from "./types/registry-url";
import { recordEntries } from "./utils/record-utils";
import { addToCache, emptyPackumentCache } from "./packument-cache";
import {
Expand All @@ -23,7 +23,6 @@ import {
tryResolve,
tryResolveFromCache,
} from "./packument-resolving";
import { unityRegistryUrl } from "../test/mock-registry";

export type NpmClient = {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/types/registry-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ export function coerceRegistryUrl(s: string): RegistryUrl {
s = removeTrailingSlash(s);
return registryUrl(s);
}

export const unityRegistryUrl = registryUrl("https://packages.unity.com");
3 changes: 1 addition & 2 deletions test/mock-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import nock from "nock";
import { SearchEndpointResult } from "./types";
import { isDomainName } from "../src/types/domain-name";
import assert from "assert";
import { registryUrl } from "../src/types/registry-url";
import { registryUrl, unityRegistryUrl } from "../src/types/registry-url";
import { UnityPackument } from "../src/types/packument";

export const unityRegistryUrl = registryUrl("https://packages.unity.com");
export const exampleRegistryUrl = registryUrl("http://example.com");

export function startMockRegistry() {
Expand Down

0 comments on commit 54e34cb

Please sign in to comment.