Skip to content

Commit

Permalink
tests updated to include all coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkPurple141 committed Jun 4, 2018
1 parent 6d3def2 commit 48c5b95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
9 changes: 0 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ module.exports = (() => {
getFileContents(file = missingParameter()) {
return this.get(file)
.then(data => this.decode(data.content))
.catch(err => {
throw err
})
}

/**
Expand All @@ -114,9 +111,6 @@ module.exports = (() => {
const uri = `${API_URL}/repositories`
return this.axios.get(uri)
.then(response => response.data)
.catch(err => {
throw err
})
}

/**
Expand All @@ -129,9 +123,6 @@ module.exports = (() => {
const uri = `${API_URL}/repos/${owner}/${repo}`
return this.axios.get(uri)
.then(response => response.data)
.catch(err => {
throw err
})
}

/**
Expand Down
16 changes: 16 additions & 0 deletions test/test_basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,20 @@ describe("# valid-api-errors", function() {
}
})

it ("Try to getRepo() with a bad path provided", () => {
let a = new api({token: GPG_KEY, username: "jeff", pw: "secret"})
a.getRepo('fake.md', 'fake')
.catch(err => {
assert(err)
})
})

it ("Try to listRepos() for a bad username", () => {
let a = new api({username: "jeff", pw: "secret"})
a.listRepos()
.catch(err => {
assert(err)
})
})

})

0 comments on commit 48c5b95

Please sign in to comment.