1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-10 22:00:05 +00:00

chore(*): clean up, address review comments

This commit is contained in:
Krishna Acondy
2021-02-02 08:42:01 +00:00
parent 36cfaee5db
commit 60a1f84604
5 changed files with 17 additions and 33 deletions

View File

@@ -85,21 +85,19 @@ describe('FileUploader', () => {
})
})
// it('should throw an error when invalid JSON is returned by the server', async (done) => {
// mockedAxios.post.mockImplementation(() =>
// Promise.resolve({ data: '{invalid: "json"' })
// )
it('should throw an error when invalid JSON is returned by the server', async (done) => {
mockedAxios.post.mockImplementation(() =>
Promise.resolve({ data: '{invalid: "json"' })
)
// const sasJob = 'test'
// const { files, params } = prepareFilesAndParams()
const sasJob = 'test'
const { files, params } = prepareFilesAndParams()
// fileUploader.uploadFile(sasJob, files, params).catch((err: any) => {
// expect(err.error.message).toEqual(
// 'Error while parsing json from upload response.'
// )
// done()
// })
// })
fileUploader.uploadFile(sasJob, files, params).catch((err: any) => {
expect(err.error.message).toEqual('File upload request failed.')
done()
})
})
it('should throw an error when the server request fails', async (done) => {
mockedAxios.post.mockImplementation(() =>