@@ -24,7 +24,7 @@ const mockAdapter = {
24
24
25
25
// Small additional tests to improve overall coverage
26
26
describe ( 'FilesController' , ( ) => {
27
- it ( 'should properly expand objects' , ( done ) => {
27
+ it ( 'should properly expand objects' , done => {
28
28
const config = Config . get ( Parse . applicationId ) ;
29
29
const gridStoreAdapter = new GridFSBucketAdapter (
30
30
'mongodb://localhost:27017/parse'
@@ -48,7 +48,7 @@ describe('FilesController', () => {
48
48
done ( ) ;
49
49
} ) ;
50
50
51
- it ( 'should create a server log on failure' , ( done ) => {
51
+ it ( 'should create a server log on failure' , done => {
52
52
const logController = new LoggerController ( new WinstonLoggerAdapter ( ) ) ;
53
53
54
54
reconfigureServer ( { filesAdapter : mockAdapter } )
@@ -57,28 +57,28 @@ describe('FilesController', () => {
57
57
( ) => done . fail ( 'should not succeed' ) ,
58
58
( ) => setImmediate ( ( ) => Promise . resolve ( 'done' ) )
59
59
)
60
- . then ( ( ) => new Promise ( ( resolve ) => setTimeout ( resolve , 200 ) ) )
60
+ . then ( ( ) => new Promise ( resolve => setTimeout ( resolve , 200 ) ) )
61
61
. then ( ( ) =>
62
62
logController . getLogs ( { from : Date . now ( ) - 1000 , size : 1000 } )
63
63
)
64
- . then ( ( logs ) => {
64
+ . then ( logs => {
65
65
// we get two logs here: 1. the source of the failure to save the file
66
66
// and 2 the message that will be sent back to the client.
67
67
68
68
const log1 = logs . find (
69
- ( x ) => x . message === 'Error creating a file: it failed with xyz'
69
+ x => x . message === 'Error creating a file: it failed with xyz'
70
70
) ;
71
71
expect ( log1 . level ) . toBe ( 'error' ) ;
72
72
73
- const log2 = logs . find ( ( x ) => x . message === 'it failed with xyz' ) ;
73
+ const log2 = logs . find ( x => x . message === 'it failed with xyz' ) ;
74
74
expect ( log2 . level ) . toBe ( 'error' ) ;
75
75
expect ( log2 . code ) . toBe ( 130 ) ;
76
76
77
77
done ( ) ;
78
78
} ) ;
79
79
} ) ;
80
80
81
- it ( 'should create a parse error when a string is returned' , ( done ) => {
81
+ it ( 'should create a parse error when a string is returned' , done => {
82
82
const mock2 = mockAdapter ;
83
83
mock2 . validateFilename = ( ) => {
84
84
return 'Bad file! No biscuit!' ;
@@ -91,7 +91,7 @@ describe('FilesController', () => {
91
91
done ( ) ;
92
92
} ) ;
93
93
94
- it ( 'should add a unique hash to the file name when the preserveFileName option is false' , ( done ) => {
94
+ it ( 'should add a unique hash to the file name when the preserveFileName option is false' , done => {
95
95
const config = Config . get ( Parse . applicationId ) ;
96
96
const gridStoreAdapter = new GridFSBucketAdapter (
97
97
'mongodb://localhost:27017/parse'
@@ -114,7 +114,7 @@ describe('FilesController', () => {
114
114
done ( ) ;
115
115
} ) ;
116
116
117
- it ( 'should not add a unique hash to the file name when the preserveFileName option is true' , ( done ) => {
117
+ it ( 'should not add a unique hash to the file name when the preserveFileName option is true' , done => {
118
118
const config = Config . get ( Parse . applicationId ) ;
119
119
const gridStoreAdapter = new GridFSBucketAdapter (
120
120
'mongodb://localhost:27017/parse'
@@ -145,7 +145,7 @@ describe('FilesController', () => {
145
145
expect ( result ) . toEqual ( { } ) ;
146
146
} ) ;
147
147
148
- it ( 'should reject slashes in file names' , ( done ) => {
148
+ it ( 'should reject slashes in file names' , done => {
149
149
const gridStoreAdapter = new GridFSBucketAdapter (
150
150
'mongodb://localhost:27017/parse'
151
151
) ;
@@ -154,7 +154,7 @@ describe('FilesController', () => {
154
154
done ( ) ;
155
155
} ) ;
156
156
157
- it ( 'should also reject slashes in file names' , ( done ) => {
157
+ it ( 'should also reject slashes in file names' , done => {
158
158
const gridStoreAdapter = new GridStoreAdapter (
159
159
'mongodb://localhost:27017/parse'
160
160
) ;
0 commit comments