Skip to content

Commit d1b408c

Browse files
author
Mike Patnode
committed
Minor test improvements
1 parent 63f4be4 commit d1b408c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spec/test.spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const AWS = require('aws-sdk');
22
const config = require('config');
33
const filesAdapterTests = require('parse-server-conformance-tests').files;
4+
const Parse = require('parse/node').Parse;
45
const S3Adapter = require('../index.js');
56
const optionsFromArguments = require('../lib/optionsFromArguments');
67

@@ -311,7 +312,7 @@ describe('S3Adapter tests', () => {
311312
it('should not allow directories when strict', () => {
312313
options.fileNameCheck = 'strict';
313314
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);
315316
});
316317

317318
it('should allow directories when safe', () => {
@@ -323,7 +324,7 @@ describe('S3Adapter tests', () => {
323324
it('should allow not allow emojis when safe', () => {
324325
options.fileNameCheck = 'safe';
325326
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);
327328
});
328329

329330
it('should allow allow emojis when loose', () => {

0 commit comments

Comments
 (0)