-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
37 lines (31 loc) · 1.18 KB
/
test.js
File metadata and controls
37 lines (31 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import test from 'ava'
import pkgstat from '.'
test('somePkgWhichDoesNotExist in someLanguageWhichDoesNotExist', async t => {
const data = await pkgstat('somePkgWhichDoesNotExist', 'someLanguageWhichDoesNotExist')
t.is(data.statusCode, 404)
})
test('cleanslate pkg exists in python(pip)', async t => {
const data = await pkgstat('cleanslate', 'python')
t.is(data.author, 'Pradeep Khileri')
})
test('someXXXRandomXXXPkgName pkg does not exists in python(pip)', async t => {
const data = await pkgstat('someXXXRandomXXXPkgName', 'python')
t.is(data.statusCode, 404)
})
test('express pkg exists in node(npm)', async t => {
const data = await pkgstat('express', 'node')
t.is(data.statusCode, 200)
})
test('someXXXRandomXXXPkgName pkg does not exists in node(npm)', async t => {
const data = await pkgstat('someXXXRandomXXXPkgName', 'node')
t.is(data.statusCode, 404)
})
test('tweep pkg in ruby(gem)', async t => {
const data = await pkgstat('tweep', 'ruby')
// console.log(data)
t.is(data.statusCode, 200)
})
test('someXXXRandomXXXPkgName pkg does not exists in ruby(gem)', async t => {
const data = await pkgstat('someXXXRandomXXXPkgName', 'ruby')
t.is(data.statusCode, 404)
})