mirror of
https://github.com/axios/axios.git
synced 2026-04-13 02:51:56 +08:00
* 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>
23 lines
543 B
JavaScript
23 lines
543 B
JavaScript
const {spawn} = require('child_process');
|
|
|
|
const args = process.argv.slice(2);
|
|
|
|
console.log(`Running ${args.join(' ')} on ${process.version}\n`);
|
|
|
|
const match = /v(\d+)/.exec(process.version);
|
|
|
|
const isHotfixNeeded = match && match[1] > 16;
|
|
|
|
isHotfixNeeded && console.warn('Setting --openssl-legacy-provider as ssl hotfix');
|
|
|
|
const test = spawn('cross-env',
|
|
isHotfixNeeded ? ['NODE_OPTIONS=--openssl-legacy-provider', ...args] : args, {
|
|
shell: true,
|
|
stdio: 'inherit'
|
|
}
|
|
);
|
|
|
|
test.on('exit', function (code) {
|
|
process.exit(code)
|
|
})
|