2017-02-14 66 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