1
1
const AWS = require ( 'aws-sdk' ) ;
2
2
const config = require ( 'config' ) ;
3
3
const filesAdapterTests = require ( 'parse-server-conformance-tests' ) . files ;
4
+ const Parse = require ( 'parse/node' ) . Parse ;
4
5
const S3Adapter = require ( '../index.js' ) ;
5
6
const optionsFromArguments = require ( '../lib/optionsFromArguments' ) ;
6
7
@@ -311,7 +312,7 @@ describe('S3Adapter tests', () => {
311
312
it ( 'should not allow directories when strict' , ( ) => {
312
313
options . fileNameCheck = 'strict' ;
313
314
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'myBucket' , options ) ;
314
- expect ( s3 . validateFilename ( 'foo/bar' ) ) . not . toBe ( null ) ;
315
+ expect ( s3 . validateFilename ( 'foo/bar' ) instanceof Parse . Error ) . toBe ( true ) ;
315
316
} ) ;
316
317
317
318
it ( 'should allow directories when safe' , ( ) => {
@@ -323,7 +324,7 @@ describe('S3Adapter tests', () => {
323
324
it ( 'should allow not allow emojis when safe' , ( ) => {
324
325
options . fileNameCheck = 'safe' ;
325
326
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'myBucket' , options ) ;
326
- expect ( s3 . validateFilename ( 'foo🛒/bar' ) ) . not . toBe ( null ) ;
327
+ expect ( s3 . validateFilename ( 'foo🛒/bar' ) instanceof Parse . Error ) . toBe ( true ) ;
327
328
} ) ;
328
329
329
330
it ( 'should allow allow emojis when loose' , ( ) => {
0 commit comments