diff --git a/polyfill/ci_test.sh b/polyfill/ci_test.sh index c8490641b4..df81484b01 100755 --- a/polyfill/ci_test.sh +++ b/polyfill/ci_test.sh @@ -23,7 +23,11 @@ fi cd test/ -threads=$(nproc --ignore 1) +if [ "$(uname)" = 'Darwin' ]; then + threads=$(sysctl -n hw.logicalcpu) +else + threads=$(nproc --ignore 1) +fi if [ $threads -gt 2 ]; then threads=2; fi test262-harness \ diff --git a/polyfill/test/transform.test262.js b/polyfill/test/transform.test262.js index 2060bcca54..9d87d7d55a 100644 --- a/polyfill/test/transform.test262.js +++ b/polyfill/test/transform.test262.js @@ -4,6 +4,6 @@ const fs = require('fs'); const {v4: uuid} = require('uuid'); const filename = '../coverage/tmp/transformer/' + uuid() + '.json'; fs.mkdirSync('../coverage/tmp/transformer/', { recursive: true }); -fs.writeFileSync(filename, JSON.stringify(globalThis.__coverage__), 'utf-8'); +fs.writeFileSync(filename, JSON.stringify(globalThis.__coverage__ || {}), 'utf-8'); `; };