mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
18 lines
649 B
JavaScript
18 lines
649 B
JavaScript
import NodeEnvironment from 'jest-environment-node';
|
|
class CustomEnvironment extends NodeEnvironment {
|
|
async handleTestEvent(event) {
|
|
if (event.name === 'test_start') {
|
|
if (!process.env.RETRY) return;
|
|
|
|
const fullName = (event.test.parent.name === 'ROOT_DESCRIBE_BLOCK' ? '' : event.test.parent.name + ' ') + event.test.name;
|
|
const hash = require('crypto').createHash('md5').update(fullName).digest('hex');
|
|
if (require('fs').existsSync(`/tmp/${hash}`)) {
|
|
event.test.mode = 'skip';
|
|
console.log('skipping as it previously passed on CI:', fullName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = CustomEnvironment;
|