Tests

Tests: 3/3 passedTests3/3 passed
✅ project on main branch (1ms)
{
  "name": "project on main branch",
  "input": "https://esm.town/v/maxm/queue@11-main/runMigrations",
  "expected": {
    "username": "maxm",
    "name": "queue",
    "version": "11",
    "branch": "main",
    "path": "runMigrations",
    "links": {
      "self": {
        "latest": "https://www.val.town/x/maxm/queue/code/runMigrations",
        "pinned": "https://www.val.town/x/maxm/queue/branch/main/version/11/code/runMigrations",
        "project": "https://www.val.town/x/maxm/queue"
      },
      "module": {
        "latest": "https://esm.town/v/maxm/queue/runMigrations",
        "pinned": "https://esm.town/v/maxm/queue@11-main/runMigrations",
        "project": "https://esm.town/v/maxm/queue/",
        "projectPinned": "https://esm.town/v/maxm/queue@11-main/"
      }
    }
  }
}
✅ project on feature branch (1ms)
{
  "name": "project on feature branch",
  "input": "https://esm.town/v/user/project@1-feature-branch-name/path/asdf/asfd/asdf/asfd",
  "expected": {
    "username": "user",
    "name": "project",
    "version": "1",
    "branch": "feature-branch-name",
    "path": "path/asdf/asfd/asdf/asfd",
    "links": {
      "self": {
        "latest": "https://www.val.town/x/user/project/branch/feature-branch-name/code/path/asdf/asfd/asdf/asfd",
        "pinned": "https://www.val.town/x/user/project/branch/feature-branch-name/version/1/code/path/asdf/asfd/asdf/asfd",
        "project": "https://www.val.town/x/user/project"
      },
      "module": {
        "latest": "https://esm.town/v/user/project/branch/feature-branch-name/path/asdf/asfd/asdf/asfd",
        "pinned": "https://esm.town/v/user/project@1-feature-branch-name/path/asdf/asfd/asdf/asfd",
        "project": "https://esm.town/v/user/project/",
        "projectPinned": "https://esm.town/v/user/project@1-feature-branch-name/"
      }
    }
  }
}
✅ project on complex branch with dashes and weird file name (1ms)
{
  "name": "project on complex branch with dashes and weird file name",
  "input": "https://esm.town/v/dev/app@22-complex-branch-with-dashes/project.foo.bar",
  "expected": {
    "username": "dev",
    "name": "app",
    "version": "22",
    "branch": "complex-branch-with-dashes",
    "path": "project.foo.bar",
    "links": {
      "self": {
        "latest": "https://www.val.town/x/dev/app/branch/complex-branch-with-dashes/code/project.foo.bar",
        "pinned": "https://www.val.town/x/dev/app/branch/complex-branch-with-dashes/version/22/code/project.foo.bar",
        "project": "https://www.val.town/x/dev/app"
      },
      "module": {
        "latest": "https://esm.town/v/dev/app/branch/complex-branch-with-dashes/project.foo.bar",
        "pinned": "https://esm.town/v/dev/app@22-complex-branch-with-dashes/project.foo.bar",
        "project": "https://esm.town/v/dev/app/",
        "projectPinned": "https://esm.town/v/dev/app@22-complex-branch-with-dashes/"
      }
    }
  }
}