File tree 2 files changed +22
-5
lines changed
2 files changed +22
-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
+ var yaml = require ( 'js-yaml' ) ;
4
+
5
+ tap . test ( 'only twice error' , function ( assert ) {
6
+ var test = tape . createHarness ( { exit : false } ) ;
7
+
8
+ test . only ( "first only" , function ( t ) {
9
+ t . end ( )
10
+ } ) ;
11
+
12
+ assert . throws ( function ( ) {
13
+ test . only ( 'second only' , function ( t ) {
14
+ t . end ( ) ;
15
+ } ) ;
16
+ } , {
17
+ name : 'Error' ,
18
+ message : 'there can only be one only test'
19
+ } ) ;
20
+ assert . end ( ) ;
21
+ } ) ;
22
+
You can’t perform that action at this time.
0 commit comments