Skip to content

Commit b99178d

Browse files
committed
Remove irrelevant use of done from non-asynchronous tests
1 parent 7f1c7ed commit b99178d

File tree

3 files changed

+19
-53
lines changed

3 files changed

+19
-53
lines changed

test/patch_wordpress_test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,23 @@ var grunt = require( 'grunt' ),
88

99
describe( 'grunt_patch_wordpress', function() {
1010
describe( 'sanity checks', function() {
11-
it( 'a is a', function( done ) {
11+
it( 'a is a', function() {
1212
expect( 'a' ).toEqual( 'a' );
13-
done();
1413
});
1514

1615
});
1716

18-
it( 'convertToRaw converts urls', function( done ) {
17+
it( 'convertToRaw converts urls', function() {
1918
expect( trac.convertToRaw ( url.parse( 'https://core.trac.wordpress.org/attachment/ticket/26700/26700.diff' ) ) ).toEqual( 'https://core.trac.wordpress.org/raw-attachment/ticket/26700/26700.diff' );
20-
done();
2119
});
2220

2321
describe( 'Level Calculator', function() {
2422

2523
// @TODO: Find alot of patches to use here
2624

27-
it ( '26602.2.diff is 0', function( done ) {
25+
it ( '26602.2.diff is 0', function() {
2826
var file = grunt.file.read( 'test/fixtures/26602.2.diff' );
2927
expect( patch.isAb( file ) ).toBe( false );
30-
done();
3128
});
3229
});
3330

test/patches.js

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,83 +17,60 @@ var grunt = require( 'grunt' ),
1717

1818
describe( 'Patch helpers', function() {
1919

20-
it( 'git a/b diffs should not automatticaly trigger moving to src', function( done ) {
20+
it( 'git a/b diffs should not automatticaly trigger moving to src', function() {
2121
expect( patch.moveToSrc( abyes ) ).not.toBe( true );
22-
23-
done();
2422
});
2523

26-
it( 'tests diffs should always be applied in the root of the checkout', function( done ) {
24+
it( 'tests diffs should always be applied in the root of the checkout', function() {
2725

2826
expect( patch.moveToSrc( testsGit ) ).not.toBe( true );
2927
expect( patch.moveToSrc( testsSvn ) ).not.toBe( true );
30-
31-
done();
3228
});
3329

34-
it( 'dev.git diffs should always be applied in the root of the checkout', function( done ) {
30+
it( 'dev.git diffs should always be applied in the root of the checkout', function() {
3531

3632
expect( patch.moveToSrc( developGit ) ).not.toBe( true );
3733
expect( patch.moveToSrc( developIndexGit ) ).not.toBe( true );
38-
39-
done();
4034
});
4135

42-
it( 'dev.svn diffs should always be applied in the root of the checkout', function( done ) {
36+
it( 'dev.svn diffs should always be applied in the root of the checkout', function() {
4337

4438
expect( patch.moveToSrc( developSvn ) ).not.toBe( true );
4539
expect( patch.moveToSrc( developIndexSvn ) ).not.toBe( true );
46-
47-
done();
4840
});
4941

50-
it( 'core.git.wordpress.org diffs should always be applied in the svn folder', function( done ) {
42+
it( 'core.git.wordpress.org diffs should always be applied in the svn folder', function() {
5143

5244
expect( patch.moveToSrc( coreGit ) ).toBe( true );
53-
54-
done();
5545
});
5646

57-
it( 'core.svn.wordpress.org diffs should always be applied in the svn folder', function( done ) {
47+
it( 'core.svn.wordpress.org diffs should always be applied in the svn folder', function() {
5848

5949
expect( patch.moveToSrc( coreSvn ) ).toBe( true );
60-
61-
done();
6250
});
6351

64-
it( 'core.svn.wordpress.org diffs from trunk should always be applied in the src folder', function( done ) {
52+
it( 'core.svn.wordpress.org diffs from trunk should always be applied in the src folder', function() {
6553

6654
expect( patch.moveToSrc( coreTrunkSvn ) ).toBe( true );
6755
expect( patch.isAb( coreTrunkSvn ) ).toBe( true );
68-
69-
done();
7056
});
7157

72-
it( 'index.php should always be applied in the src folder', function( done ) {
73-
58+
it( 'index.php should always be applied in the src folder', function() {
7459
expect( patch.moveToSrc( coreIndexSvn ) ).toBe( true );
7560
expect( patch.moveToSrc( coreIndexGit ) ).toBe( true );
76-
77-
done();
78-
7961
});
8062

81-
it( 'wp-config-sample.php should always be applied in the root folder', function( done ) {
63+
it( 'wp-config-sample.php should always be applied in the root folder', function() {
8264
expect( patch.moveToSrc( developSampleSvn ) ).not.toBe( true );
8365
expect( patch.moveToSrc( developSampleGit ) ).not.toBe( true );
84-
85-
done();
86-
8766
});
8867

89-
it ( 'isAb should return true on patches with a/ b/ style', function( done ) {
68+
it ( 'isAb should return true on patches with a/ b/ style', function() {
9069

9170
expect( patch.isAb( abyes ) ).toBe( true );
92-
93-
done();
9471
});
9572

96-
it ( 'isAb should return false on patches without a/ b/ style', function( done ) {
73+
it ( 'isAb should return false on patches without a/ b/ style', function() {
9774

9875
expect( patch.isAb( developSampleGit ) ).not.toBe( true );
9976
expect( patch.isAb( developSampleSvn ) ).not.toBe( true );
@@ -107,8 +84,6 @@ describe( 'Patch helpers', function() {
10784
expect( patch.isAb( developIndexSvn ) ).not.toBe( true );
10885
expect( patch.isAb( testsGit ) ).not.toBe( true );
10986
expect( patch.isAb( testsSvn ) ).not.toBe( true );
110-
111-
done();
11287
});
11388

11489
});

test/regex.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,38 @@ var grunt = require( 'grunt' ),
55
html23994 = grunt.file.read ( 'test/fixtures/23994.html' );
66

77
describe( 'regular expressions', function() {
8-
it( 'multiple patches on a ticket with non patches as well', function( done ) {
8+
it( 'multiple patches on a ticket with non patches as well', function() {
99
var matches = regex.patchAttachments( html23988 ),
1010
longMatches = regex.longMatches( html23988 ),
1111
possiblePatches = regex.possiblePatches( longMatches );
1212

1313
expect( matches.length ).toBe( 2 );
1414
expect( longMatches.length ).toBe( 4 );
1515
expect( possiblePatches.length ).toBe( 2 );
16-
17-
done();
1816
});
1917

20-
it( 'one patch on a ticket', function( done ) {
18+
it( 'one patch on a ticket', function() {
2119
var matches = regex.patchAttachments( html23994 );
2220

2321
expect( matches.length ).toBe( 1 );
24-
done();
2522
});
2623

27-
it( 'url from a list of attachments', function( done ) {
24+
it( 'url from a list of attachments', function() {
2825
var matches = regex.patchAttachments( html23994 );
2926
url = 'core.trac.wordpress.org' + regex.urlsFromAttachmentList( matches[0])[1];
3027

3128
expect( url ).toBe( 'core.trac.wordpress.org/attachment/ticket/23994/23994.diff' );
32-
done();
3329
});
3430

35-
it( 'no patches on a ticket', function( done ) {
31+
it( 'no patches on a ticket', function() {
3632
var matches = regex.patchAttachments( html23989 );
3733

3834
expect( matches ).toBeNull();
39-
done();
4035
});
4136

42-
it( 'filenames should be cleaned', function( done ) {
37+
it( 'filenames should be cleaned', function() {
4338
var filename = '? one.diff';
4439

4540
expect( regex.localFileClean( filename ) ).toEqual( 'one.diff' );
46-
done();
4741
});
4842
});

0 commit comments

Comments
 (0)