-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.spec.js
75 lines (68 loc) · 2.12 KB
/
index.spec.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
'use strict'
var describe = require('mocha').describe
var it = require('mocha').it
var expect = require('chai').expect
var shieldman = require('./index')
describe('shieldman', function () {
it('travis', function () {
var shield = shieldman('travis', {
repo: 'zkochan/shieldman',
})
expect(shield).to.eql({
text: 'Build Status',
image: 'https://img.shields.io/travis/zkochan/shieldman.svg',
link: 'https://travis-ci.org/zkochan/shieldman',
})
})
it('coveralls for branch', function () {
var shield = shieldman('coveralls', {
repo: 'zkochan/shieldman',
branch: 'dev',
})
expect(shield).to.eql({
text: 'Coverage Status',
image: 'https://img.shields.io/coveralls/zkochan/shieldman/dev.svg',
link: 'https://coveralls.io/r/zkochan/shieldman?branch=dev',
})
})
it('standard shield when branch shield not supported', function () {
var shield = shieldman('npm', {
npmName: 'shieldman',
branch: 'dev',
})
expect(shield).to.eql({
text: 'npm version',
image: 'https://img.shields.io/npm/v/shieldman.svg',
link: 'https://www.npmjs.com/package/shieldman',
})
})
it('flat square styled travis', function () {
var shield = shieldman('travis', {
style: 'flat-square',
repo: 'zkochan/shieldman',
})
expect(shield).to.eql({
text: 'Build Status',
image: 'https://img.shields.io/travis/zkochan/shieldman.svg?style=flat-square',
link: 'https://travis-ci.org/zkochan/shieldman',
})
})
it('gemnasium', function () {
var shield = shieldman('gemnasium', {
repo: 'zkochan/shieldman',
})
expect(shield).to.eql({
text: 'Gemnasium',
image: 'https://img.shields.io/gemnasium/zkochan/shieldman.svg',
link: 'https://gemnasium.com/zkochan/shieldman',
})
})
it('spacemacs', function () {
var shield = shieldman('spacemacs')
expect(shield).to.eql({
text: 'Built with Spacemacs',
image: 'https://raw.githubusercontent.com/syl20bnr/spacemacs/master/assets/spacemacs-badge.svg?sanitize=true',
link: 'http://spacemacs.org',
})
})
})