2017-02-14 42 views

回答

0

看起来像[email protected]它可以通过这种方式来完成:

/path/to/reporter-setup.js

function getTestPath() { 
    if (Symbol && typeof Symbol.for === 'function') { 
    var globalStateKey = Symbol.for('$$jest-matchers-object'); 
    if (globalStateKey) { 
     var globalState = global[globalStateKey]; 
     if (globalState) { 
     var state = globalState.state; 
     if (state) { 
      return state.testPath; 
     } 
     } 
    } 
    } 
} 

开玩笑--setupTestFrameworkScriptFile /路径/到/ reporter-setup.js