Browse Source

remove error test

I should add “not adding file if returned false” test instead
Artur Paikin 7 years ago
parent
commit
c7f4d7f48f
1 changed files with 0 additions and 20 deletions
  1. 0 20
      src/core/Core.test.js

+ 0 - 20
src/core/Core.test.js

@@ -617,26 +617,6 @@ describe('src/Core', () => {
         expect(err.message).toEqual('You can only upload: image/gif')
         expect(err.message).toEqual('You can only upload: image/gif')
       }
       }
     })
     })
-
-    it('should work with restriction errors that are not Error class instances', () => {
-      const core = new Core({
-        onBeforeFileAdded () {
-          throw 'a plain string' // eslint-disable-line no-throw-literal
-        }
-      })
-
-      try {
-        core.addFile({
-          source: 'jest',
-          name: 'foo.jpg',
-          type: 'image/jpeg',
-          data: null
-        })
-        throw new Error('should have thrown')
-      } catch (err) {
-        expect(err).toMatchObject(new Error('a plain string'))
-      }
-    })
   })
   })
 
 
   describe('uploading a file', () => {
   describe('uploading a file', () => {