axios-axios/test/unit/helpers/fromDataURI.js
Dmitriy Mozgovoy 467025bdb7
Fixed bug #4727 : toFormData Blob issue on node>v17; (#4728)
* Fixed bug #4727;
Added node 18.x to the CI;
Added hotfix for `ERR_OSSL_EVP_UNSUPPORTED` issue with karma running on node >=17.x;
Added `cross-env` to allow running build and test scripts on Windows platforms;

* Added conditional setting of `--openssl-legacy-provider` option for node versions >=17.x;

* Refactored ssl-hotfix & test script;

* Fixed and refactored default max body length test due to ECONNRESET failure;

* Added test for converting the data uri to a Blob;
Fixed bug with parsing mime type for Blob;

Co-authored-by: Jay <jasonsaayman@gmail.com>
2022-05-20 16:31:26 +02:00

13 lines
404 B
JavaScript

var assert = require('assert');
var fromDataURI = require('../../../lib/helpers/fromDataURI');
describe('helpers::fromDataURI', function () {
it('should return buffer from data uri', function () {
const buffer= Buffer.from('123');
const dataURI = 'data:application/octet-stream;base64,' + buffer.toString('base64');
assert.deepStrictEqual(fromDataURI(dataURI, false), buffer);
});
});