Skip to content

[server] testEmptyProject of the GitLab context parser fails #4773

Closed
@corneliusludmann

Description

@corneliusludmann

The testEmptyProject of the GitLab context parser fails:

@test public async testEmptyProject() {
const result = await this.parser.handle({}, this.user, 'https://gitlab.com/gp-test-group/gp-test-empty-project');
expect(result).to.deep.include({
"ref": undefined,
"refType": undefined,
"revision": undefined,
"isFile": false,
"repository": {
"host": "gitlab.com",
"owner": "gp-test-group",
"name": "gp-test-empty-project",
"cloneUrl": "https://gitlab.com/gp-test-group/gp-test-empty-project.git",
"private": false,
"defaultBranch": null
},
"title": "gp-test-group/gp-test-empty-project"
})
}

1) TestGitlabContextParser
       testEmptyProject:
     AssertionError: expected { Object (isFile, path, ...) } to have deep property 'ref'
      at TestGitlabContextParser.<anonymous> (src/gitlab/gitlab-context-parser.spec.ts:549:36)
      at Generator.next (<anonymous>)
      at fulfilled (src/gitlab/gitlab-context-parser.spec.ts:19:58)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

The actual result is:

{
  "isFile": false,
  "path": "",
  "title": "gp-test-group/gp-test-empty-project - main",
  "revision": "",
  "repository": {
    "host": "gitlab.com",
    "name": "gp-test-empty-project",
    "owner": "gp-test-group",
    "cloneUrl": "https://gitlab.com/gp-test-group/gp-test-empty-project.git",
    "defaultBranch": "main",
    "private": false
  }
}

Opening the empty workspace actually works, though. It's just the test that fails and needs to be fixed.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions