File tree 2 files changed +21
-5
lines changed
2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,6 @@ Results.prototype.push = function (t) {
84
84
} ;
85
85
86
86
Results . prototype . only = function ( name ) {
87
- if ( this . _only ) {
88
- self . count ++ ;
89
- self . fail ++ ;
90
- write ( 'not ok ' + self . count + ' already called .only()\n' ) ;
91
- }
92
87
this . _only = name ;
93
88
} ;
94
89
Original file line number Diff line number Diff line change
1
+ var tape = require ( '../' ) ;
2
+ var tap = require ( 'tap' ) ;
3
+
4
+ tap . test ( 'only twice error' , function ( assert ) {
5
+ var test = tape . createHarness ( { exit : false } ) ;
6
+
7
+ test . only ( "first only" , function ( t ) {
8
+ t . end ( )
9
+ } ) ;
10
+
11
+ assert . throws ( function ( ) {
12
+ test . only ( 'second only' , function ( t ) {
13
+ t . end ( ) ;
14
+ } ) ;
15
+ } , {
16
+ name : 'Error' ,
17
+ message : 'there can only be one only test'
18
+ } ) ;
19
+ assert . end ( ) ;
20
+ } ) ;
21
+
You can’t perform that action at this time.
0 commit comments