New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update blob-util to 2.0.2 #7795
Merged
jennifer-shehane
merged 7 commits into
cypress-io:v5.0-release
from
sainthkh:issue-6001-2
Jul 7, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0ccc60f
Update blob-util to 2.0.2
sainthkh bda3e0b
Fix test.
sainthkh 5ed0dd3
Fix blob-util type.
sainthkh 3ac8e59
Bundle blob-util.
sainthkh f923f0b
Show warning message.
sainthkh cd56fe4
Show function name in error message.
sainthkh 21510b5
Fix message.
sainthkh File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/driver/cypress/integration/util/breaking_change_warnings_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
describe('blob-util 2.x', () => { | ||
it('arrayBufferToBlob', () => { | ||
cy.on('fail', (err) => { | ||
expect(err.message).to.include('no longer returns a `Promise`') | ||
}) | ||
|
||
Cypress.Blob.arrayBufferToBlob('1234').then((blob) => { | ||
// it should fail. | ||
}) | ||
}) | ||
|
||
it('base64StringToBlob', () => { | ||
cy.on('fail', (err) => { | ||
expect(err.message).to.include('no longer returns a `Promise`') | ||
}) | ||
|
||
Cypress.Blob.base64StringToBlob('1234').then((blob) => { | ||
// it should fail. | ||
}) | ||
}) | ||
|
||
it('binaryStringToBlob', () => { | ||
cy.on('fail', (err) => { | ||
expect(err.message).to.include('no longer returns a `Promise`') | ||
}) | ||
|
||
Cypress.Blob.binaryStringToBlob('0100101').then((blob) => { | ||
// it should fail. | ||
}) | ||
}) | ||
|
||
it('dataURLToBlob', () => { | ||
cy.on('fail', (err) => { | ||
expect(err.message).to.include('no longer returns a `Promise`') | ||
}) | ||
|
||
Cypress.Blob.dataURLToBlob('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==').then((blob) => { | ||
// it should fail. | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import $errUtil from '../cypress/error_utils' | ||
|
||
export function wrapBlobUtil (blobUtil) { | ||
const breakingChanges = [ | ||
'arrayBufferToBlob', | ||
'base64StringToBlob', | ||
'binaryStringToBlob', | ||
'dataURLToBlob', | ||
] | ||
|
||
const obj = {} | ||
|
||
Object.keys(blobUtil).forEach((key) => { | ||
if (breakingChanges.includes(key)) { | ||
obj[key] = function (...args) { | ||
const val = blobUtil[key](...args) | ||
|
||
val.then = function () { | ||
$errUtil.throwErrByPath('breaking_change.blob_util2', { | ||
args: { | ||
functionName: key, | ||
}, | ||
}) | ||
} | ||
|
||
return val | ||
} | ||
} else { | ||
obj[key] = blobUtil[key] | ||
} | ||
}) | ||
|
||
return obj | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A
(done)
callback parameter must be yielded to guarantee that thecy.on('fail', ...)
hits accordingly otherwise the test can pass if the error handle is not invoked.