1
1
'use strict' ;
2
- var test = require ( 'ava' )
2
+
3
+ var test = require ( 'tape' )
3
4
var _ = require ( 'lodash' )
4
5
var doiRegex = require ( './' ) ;
5
6
@@ -38,36 +39,42 @@ test('exact DOIs as passing', function (t) {
38
39
_ ( doi ) . each ( function ( el ) {
39
40
t . assert ( doiRegex ( { exact : true } ) . test ( el ) , el )
40
41
} )
42
+ t . end ( )
41
43
} )
42
44
43
45
test ( 'embeded DOIs as passing' , function ( t ) {
44
46
_ ( doi ) . each ( function ( el ) {
45
47
t . assert ( doiRegex ( ) . exec ( 'foo' + el ) [ 0 ] === el , el )
46
48
} )
49
+ t . end ( )
47
50
} )
48
51
49
52
test ( 'non-exact DOIs as failing' , function ( t ) {
50
53
_ ( doiNot ) . each ( function ( el ) {
51
54
t . assert ( ! doiRegex ( { exact : true } ) . test ( el ) , el )
52
55
} )
56
+ t . end ( )
53
57
} )
54
58
55
59
test ( 'DOI declared as passing' , function ( t ) {
56
60
_ ( doiDeclared ) . each ( function ( el ) {
57
61
t . assert ( doiRegex . declared ( { exact : true } ) . test ( el ) , el )
58
62
} )
63
+ t . end ( )
59
64
} )
60
65
61
66
test ( 'DOI declared embeded as passing' , function ( t ) {
62
67
_ ( doiDeclared ) . each ( function ( el ) {
63
68
t . assert ( ( doiRegex . declared ( ) . exec ( 'foo' + el ) || [ ] ) [ 0 ] === el , el )
64
69
} )
70
+ t . end ( )
65
71
} )
66
72
67
73
test ( 'DOI not declared as failing' , function ( t ) {
68
74
_ ( doiNotDeclared ) . each ( function ( el ) {
69
75
t . assert ( ! doiRegex . declared ( { exact : true } ) . test ( el ) , el )
70
76
} )
77
+ t . end ( )
71
78
} )
72
79
73
80
test ( 'DOI group catching returns original' , function ( t ) {
@@ -77,6 +84,7 @@ test('DOI group catching returns original', function (t) {
77
84
_ ( doi ) . each ( function ( el ) {
78
85
t . assert ( doiRegex . groups ( el ) [ 0 ] === el , el )
79
86
} )
87
+ t . end ( )
80
88
} )
81
89
82
90
test ( 'DOI group catching returns DOI' , function ( t ) {
@@ -86,6 +94,7 @@ test('DOI group catching returns DOI', function (t) {
86
94
_ ( doi ) . each ( function ( el ) {
87
95
t . assert ( doiRegex ( doiRegex . groups ( el ) [ 1 ] ) , el )
88
96
} )
97
+ t . end ( )
89
98
} )
90
99
91
100
test ( 'DOI group catching returns extension' , function ( t ) {
@@ -95,4 +104,5 @@ test('DOI group catching returns extension', function (t) {
95
104
_ ( doi ) . each ( function ( el ) {
96
105
t . assert ( doiRegex . groups ( el ) [ 2 ] . length === 0 , el )
97
106
} )
107
+ t . end ( )
98
108
} )
0 commit comments