Skip to content

Commit

Permalink
Use semver for version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
emilong committed Aug 26, 2020
1 parent efa9358 commit 88bc2ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/file/getFileBlobAsync.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { extname } from 'path';
import semver from 'semver';

import { ENCODING, FILE_EXTENSION } from './constants';

Expand All @@ -12,7 +13,7 @@ let wrapBlob = blob => {
return Cypress.Promise.resolve(blob);
};

if (Cypress.version < '5.0.0') {
if (semver.lt(Cypress.version, '5.0.0')) {
wrapBlob = blob => blob;
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"cypress": ">3.0.0"
},
"dependencies": {
"mime": "^2.4.4"
"mime": "^2.4.4",
"semver": "^7.3.2"
}
}

0 comments on commit 88bc2ae

Please sign in to comment.