Skip to content

Instantly share code, notes, and snippets.

@Dman757
Last active February 21, 2019 22:04
Show Gist options
  • Select an option

  • Save Dman757/a11f786c2c35d7a01f6f74a83d3c683d to your computer and use it in GitHub Desktop.

Select an option

Save Dman757/a11f786c2c35d7a01f6f74a83d3c683d to your computer and use it in GitHub Desktop.

Revisions

  1. Dman757 revised this gist Feb 21, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions jest-transpiler-error.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    account.update = (model = {}, formName = '') => async (
    dispatch,
    ) => {return} // BAD
    ) => {return} // BAD (having the arguments on a newline
    /*
    /home/dman/src/...:602
    const response = await _Account2.default.update(model);
    @@ -14,4 +14,4 @@ account.update = (model = {}, formName = '') => async (
    */


    account.update = (model = {}, formName = '') => async dispatch => {return} // GOOD tests pass
    account.update = (model = {}, formName = '') => async dispatch => {return} // GOOD tests pass with arguemtns on one line
  2. Dman757 created this gist Feb 21, 2019.
    17 changes: 17 additions & 0 deletions jest-transpiler-error.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    account.update = (model = {}, formName = '') => async (
    dispatch,
    ) => {return} // BAD
    /*
    /home/dman/src/...:602
    const response = await _Account2.default.update(model);
    ^^^^^
    SyntaxError: await is only valid in async function
    at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
    at Object.<anonymous> (src/actions/index.js:6:16)
    at Object.<anonymous> (src/....js:7:16)
    */


    account.update = (model = {}, formName = '') => async dispatch => {return} // GOOD tests pass