mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Prettier 2.0 (#393)
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
import * as GitHubUtils from "./GitHubUtils";
|
||||
|
||||
const owner = "owner-1";
|
||||
const repo = "repo-1";
|
||||
const branch = "branch/name.1-2";
|
||||
const path = "folder name/file name1:2.ipynb";
|
||||
|
||||
describe("GitHubUtils", () => {
|
||||
it("fromRepoUri parses github repo url correctly", () => {
|
||||
const repoInfo = GitHubUtils.fromRepoUri(`https://github.com/${owner}/${repo}/tree/${branch}`);
|
||||
expect(repoInfo).toEqual({
|
||||
owner,
|
||||
repo,
|
||||
branch
|
||||
});
|
||||
});
|
||||
|
||||
it("toContentUri generates github uris correctly", () => {
|
||||
const uri = GitHubUtils.toContentUri(owner, repo, branch, path);
|
||||
expect(uri).toBe(`github://${owner}/${repo}/${path}?ref=${branch}`);
|
||||
});
|
||||
|
||||
it("fromContentUri parses the github uris correctly", () => {
|
||||
const contentInfo = GitHubUtils.fromContentUri(`github://${owner}/${repo}/${path}?ref=${branch}`);
|
||||
expect(contentInfo).toEqual({
|
||||
owner,
|
||||
repo,
|
||||
branch,
|
||||
path
|
||||
});
|
||||
});
|
||||
});
|
||||
import * as GitHubUtils from "./GitHubUtils";
|
||||
|
||||
const owner = "owner-1";
|
||||
const repo = "repo-1";
|
||||
const branch = "branch/name.1-2";
|
||||
const path = "folder name/file name1:2.ipynb";
|
||||
|
||||
describe("GitHubUtils", () => {
|
||||
it("fromRepoUri parses github repo url correctly", () => {
|
||||
const repoInfo = GitHubUtils.fromRepoUri(`https://github.com/${owner}/${repo}/tree/${branch}`);
|
||||
expect(repoInfo).toEqual({
|
||||
owner,
|
||||
repo,
|
||||
branch,
|
||||
});
|
||||
});
|
||||
|
||||
it("toContentUri generates github uris correctly", () => {
|
||||
const uri = GitHubUtils.toContentUri(owner, repo, branch, path);
|
||||
expect(uri).toBe(`github://${owner}/${repo}/${path}?ref=${branch}`);
|
||||
});
|
||||
|
||||
it("fromContentUri parses the github uris correctly", () => {
|
||||
const contentInfo = GitHubUtils.fromContentUri(`github://${owner}/${repo}/${path}?ref=${branch}`);
|
||||
expect(contentInfo).toEqual({
|
||||
owner,
|
||||
repo,
|
||||
branch,
|
||||
path,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user