Skip to content

Commit

Permalink
fix test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
AzSiAz committed Mar 15, 2017
1 parent 918d4f3 commit ee1fd7d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# MangaTown-Data
[![Build Status](https://travis-ci.org/AzSiAz/MangaTown-Data.svg?branch=master)](https://travis-ci.org/AzSiAz/MangaTown-Data)
[![Coverage Status](https://coveralls.io/repos/github/AzSiAz/MangaTown-Data/badge.svg?branch=master)](https://coveralls.io/github/AzSiAz/MangaTown-Data?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/AzSiAz/MangaTown-Data/badge.svg?branch=master)](https://coveralls.io/github/AzSiAz/MangaTown-Data?branch=master)

Working mangatown data parser but not battle tested
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ global.Promise = bluebird
// import { searchManga, getPage } from './fetch'
// import getMangaList from './parser/General/getMangaList'

// searchManga('isekai', 1).then($ => {
// searchManga('cfgvhbjnkm', 500).then($ => {
// console.log(getMangaList($))
// }).catch(console.dir)
20 changes: 19 additions & 1 deletion tests/fetch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ describe('getMangaChapterPage Test', () => {
})
})

describe('searchManga Test', () => {

test('Should return cheerio object for page', async () => {
let $ = await getPage()
expect($).toBeDefined()
expect($).not.toThrow()
})

test('Should throw an error', async () => {
try {
await searchManga('cfgvhbjnkm')
}
catch(err) {
expect(err.name).toBe('Error')
}
})
})

describe('getPage Test', () => {

test('Should return cheerio object for page', async () => {
Expand All @@ -46,7 +64,7 @@ describe('getPage Test', () => {

test('Should throw an error', async () => {
try {
await await getPage('cfgvhbjnkm')
await getPage('cfgvhbjnkm')
}
catch(err) {
expect(err.name).toBe('Error')
Expand Down

0 comments on commit ee1fd7d

Please sign in to comment.