Skip to content

Commit

Permalink
fix: added getFileContents tests with and without file
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankatliarchuk committed Oct 2, 2022
1 parent a1af3e2 commit 43c202b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/platforms/gitlab/_tests/_gitlab_api.test.ts
Expand Up @@ -175,6 +175,11 @@ describe("GitLab API", () => {
ref: "master",
expected: "source 'https://rubygems.org'",
},
{
filePath: "FileNotExist",
ref: "master",
expected: "",
},
]
for (let el in parameters) {
let result = await api.getFileContents(parameters[el].filePath, api.repoMetadata.repoSlug, parameters[el].ref)
Expand Down
8 changes: 8 additions & 0 deletions source/platforms/gitlab/_tests/fixtures/getFileContents.json
Expand Up @@ -18,5 +18,13 @@
"execute_filemode": false,
"content": "c291cmNlICdodHRwczovL3J1YnlnZW1zLm9yZycK"
}
},
{
"scope": "https://gitlab.com",
"method": "GET",
"path": "/api/v4/projects/gitlab-org%2Fgitlab-foss/repository/files/FileNotExist?ref=master",
"body": "",
"status": 404,
"response": {}
}
]

0 comments on commit 43c202b

Please sign in to comment.