File tree 3 files changed +29
-35
lines changed
3 files changed +29
-35
lines changed Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
- exports = module . exports = testOptional ;
4
-
5
- function testOptional ( title , fn ) {
6
-
7
- it ( title , function ( ) {
8
- try {
9
- fn . call ( this ) ;
10
- } catch ( err ) {
11
- if ( err . message == "Not implemented" ) {
12
- this . test . skip ( ) ;
13
- } else {
14
- throw err ;
15
- }
16
- }
17
- } ) ;
18
-
19
- }
1
+ module . exports = function testOptional ( title , fn ) {
2
+ it ( title , function ( ) {
3
+ try {
4
+ fn . call ( this ) ;
5
+ } catch ( err ) {
6
+ if ( err . message === 'Not implemented' ) {
7
+ this . test . skip ( ) ;
8
+ } else {
9
+ throw err ;
10
+ }
11
+ }
12
+ } ) ;
13
+ } ;
Original file line number Diff line number Diff line change 1
1
function concatenateStrings ( value1 , value2 ) {
2
- return value1 + value2
2
+ return value1 + value2 ;
3
3
}
4
4
5
- function testingPassFunction ( value1 , value2 ) {
6
- throw new Error ( 'Not implemented' ) ;
5
+ function testingPassFunction ( ) {
6
+ throw new Error ( 'Not implemented' ) ;
7
7
}
8
8
9
9
module . exports = {
10
- concatenateStrings : concatenateStrings ,
11
- testingPassFunction : testingPassFunction ,
12
- }
10
+ concatenateStrings,
11
+ testingPassFunction,
12
+ } ;
Original file line number Diff line number Diff line change 1
- var assert = require ( 'assert' ) ;
2
- var tasks = require ( '../task/01-first-tasks' ) ;
1
+ const assert = require ( 'assert' ) ;
2
+ const tasks = require ( '../task/01-first-tasks' ) ;
3
3
it . optional = require ( '../extensions/it-optional' ) ;
4
4
5
- describe ( '01-first-tests' , function ( ) {
6
- it ( 'concatenateStrings should return concatenation of two strings' , function ( ) {
7
- assert . equal ( tasks . concatenateStrings ( 'a' , 'b' ) , 'ab' ) ;
8
- } ) ;
9
- it . optional ( 'testingPassFunction should ignore a test' , function ( ) {
10
- assert . equal ( tasks . testingPassFunction ( ) , 'ab ' ) ;
11
- } ) ;
12
- } ) ;
5
+ describe ( '01-first-tests' , ( ) => {
6
+ it ( 'concatenateStrings should return concatenation of two strings' , ( ) => {
7
+ assert . equal ( tasks . concatenateStrings ( 'a' , 'b' ) , 'ab' ) ;
8
+ } ) ;
9
+ it . optional ( 'testingPassFunction should ignore a test' , ( ) => {
10
+ assert . equal ( tasks . testingPassFunction ( ) , 'test ' ) ;
11
+ } ) ;
12
+ } ) ;
You can’t perform that action at this time.
0 commit comments