1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  */
    
  7. 
    
  8. 'use strict';
    
  9. 
    
  10. process.on('unhandledRejection', err => {
    
  11.   throw err;
    
  12. });
    
  13. 
    
  14. const runFlow = require('../flow/runFlow');
    
  15. const inlinedHostConfigs = require('../shared/inlinedHostConfigs');
    
  16. 
    
  17. // Parallelize tests across multiple tasks.
    
  18. const nodeTotal = process.env.CIRCLE_NODE_TOTAL
    
  19.   ? parseInt(process.env.CIRCLE_NODE_TOTAL, 10)
    
  20.   : 1;
    
  21. const nodeIndex = process.env.CIRCLE_NODE_INDEX
    
  22.   ? parseInt(process.env.CIRCLE_NODE_INDEX, 10)
    
  23.   : 0;
    
  24. 
    
  25. async function checkAll() {
    
  26.   for (let i = 0; i < inlinedHostConfigs.length; i++) {
    
  27.     if (i % nodeTotal === nodeIndex) {
    
  28.       const rendererInfo = inlinedHostConfigs[i];
    
  29.       if (rendererInfo.isFlowTyped) {
    
  30.         await runFlow(rendererInfo.shortName, ['check']);
    
  31.         console.log();
    
  32.       }
    
  33.     }
    
  34.   }
    
  35. }
    
  36. 
    
  37. checkAll();