Skip to content

Commit c821e87

Browse files
committed
Changed testing to tape
1 parent a519904 commit c821e87

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "doi-regex",
3-
"version": "0.0.6",
3+
"version": "0.1.0",
44
"description": "Regular expression for matching DOIs",
55
"main": "index.js",
66
"scripts": {
7-
"test": "node test.js"
7+
"test": "node test.js | node_modules/.bin/faucet"
88
},
99
"repository": {
1010
"type": "git",
@@ -38,8 +38,9 @@
3838
},
3939
"homepage": "https://github.com/BeagleLab/doi",
4040
"devDependencies": {
41-
"ava": "0.0.4",
41+
"faucet": "0.0.1",
4242
"lodash": "^2.4.1",
43-
"minimist": "^1.1.0"
43+
"minimist": "^1.1.0",
44+
"tape": "^3.0.3"
4445
}
4546
}

test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
2-
var test = require('ava')
2+
3+
var test = require('tape')
34
var _ = require('lodash')
45
var doiRegex = require('./');
56

@@ -38,36 +39,42 @@ test('exact DOIs as passing', function (t) {
3839
_(doi).each(function (el) {
3940
t.assert(doiRegex({exact: true}).test(el), el)
4041
})
42+
t.end()
4143
})
4244

4345
test('embeded DOIs as passing', function (t) {
4446
_(doi).each(function (el) {
4547
t.assert(doiRegex().exec('foo' + el)[0] === el, el)
4648
})
49+
t.end()
4750
})
4851

4952
test('non-exact DOIs as failing', function (t) {
5053
_(doiNot).each(function (el) {
5154
t.assert(!doiRegex({exact: true}).test(el), el)
5255
})
56+
t.end()
5357
})
5458

5559
test('DOI declared as passing', function (t) {
5660
_(doiDeclared).each(function (el) {
5761
t.assert(doiRegex.declared({exact: true}).test(el), el)
5862
})
63+
t.end()
5964
})
6065

6166
test('DOI declared embeded as passing', function (t) {
6267
_(doiDeclared).each(function (el) {
6368
t.assert((doiRegex.declared().exec('foo' + el) || [])[0] === el, el)
6469
})
70+
t.end()
6571
})
6672

6773
test('DOI not declared as failing', function (t) {
6874
_(doiNotDeclared).each(function (el) {
6975
t.assert(!doiRegex.declared({exact: true}).test(el), el)
7076
})
77+
t.end()
7178
})
7279

7380
test('DOI group catching returns original', function (t) {
@@ -77,6 +84,7 @@ test('DOI group catching returns original', function (t) {
7784
_(doi).each(function (el) {
7885
t.assert(doiRegex.groups(el)[0] === el, el)
7986
})
87+
t.end()
8088
})
8189

8290
test('DOI group catching returns DOI', function (t) {
@@ -86,6 +94,7 @@ test('DOI group catching returns DOI', function (t) {
8694
_(doi).each(function (el) {
8795
t.assert(doiRegex(doiRegex.groups(el)[1]), el)
8896
})
97+
t.end()
8998
})
9099

91100
test('DOI group catching returns extension', function (t) {
@@ -95,4 +104,5 @@ test('DOI group catching returns extension', function (t) {
95104
_(doi).each(function (el) {
96105
t.assert(doiRegex.groups(el)[2].length === 0, el)
97106
})
107+
t.end()
98108
})

0 commit comments

Comments
 (0)