Plugin/Preset files are not allowed to export objects: can't get jest to work with babel7 and coffee script












0














I am trying to add a test.coffee to a vue cli 3 generated project using jest-preset-coffeescript



The error, not allowed to export objects, is from babel7 github issue not "liking" babel-preset-jest, babel7 is pulled in by @vue/cli-plugin-babel@3.1.1



babel-preset-jest is pulled in by jest-preset-coffeescript



UPDATE: found this issue: https://github.com/danielbayley/jest-preset-coffeescript/issues/1



    tests/test.coffee
● Test suite failed to run

Plugin/Preset files are not allowed to export objects, only functions. In /Users/luntain/p/baz/node_modules/babel-preset-jest/index.js

at createDescriptor (node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
at items.map (node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
at Array.map (<anonymous>:null:null)
at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
at createPresetDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
at passPerPreset (node_modules/@babel/core/lib/config/config-descriptors.js:58:96)
at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
at presets.presets (node_modules/@babel/core/lib/config/config-descriptors.js:29:84)
at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:320:26)
at node_modules/@babel/core/lib/config/config-chain.js:283:7
at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:68:29)
at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)
at loadFullConfig (node_modules/@babel/core/lib/config/full.js:43:39)
at transformSync (node_modules/@babel/core/lib/transform.js:41:38)
at Object.transform (node_modules/@babel/core/lib/transform.js:22:38)
at CoffeeScript.transpile (node_modules/coffeescript/lib/coffeescript/index.js:30:18)
at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:187:26)
at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:54:19)
at CoffeeScript.compile (node_modules/coffeescript/lib/coffeescript/index.js:45:29)
at Object.exports.process (node_modules/jest-preset-coffeescript/index.js:17:36)
at Generator.next (<anonymous>:null:null)
at new Promise (<anonymous>:null:null)
at Generator.next (<anonymous>:null:null)









share|improve this question





























    0














    I am trying to add a test.coffee to a vue cli 3 generated project using jest-preset-coffeescript



    The error, not allowed to export objects, is from babel7 github issue not "liking" babel-preset-jest, babel7 is pulled in by @vue/cli-plugin-babel@3.1.1



    babel-preset-jest is pulled in by jest-preset-coffeescript



    UPDATE: found this issue: https://github.com/danielbayley/jest-preset-coffeescript/issues/1



        tests/test.coffee
    ● Test suite failed to run

    Plugin/Preset files are not allowed to export objects, only functions. In /Users/luntain/p/baz/node_modules/babel-preset-jest/index.js

    at createDescriptor (node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
    at items.map (node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
    at Array.map (<anonymous>:null:null)
    at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
    at createPresetDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
    at passPerPreset (node_modules/@babel/core/lib/config/config-descriptors.js:58:96)
    at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
    at presets.presets (node_modules/@babel/core/lib/config/config-descriptors.js:29:84)
    at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:320:26)
    at node_modules/@babel/core/lib/config/config-chain.js:283:7
    at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:68:29)
    at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)
    at loadFullConfig (node_modules/@babel/core/lib/config/full.js:43:39)
    at transformSync (node_modules/@babel/core/lib/transform.js:41:38)
    at Object.transform (node_modules/@babel/core/lib/transform.js:22:38)
    at CoffeeScript.transpile (node_modules/coffeescript/lib/coffeescript/index.js:30:18)
    at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:187:26)
    at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:54:19)
    at CoffeeScript.compile (node_modules/coffeescript/lib/coffeescript/index.js:45:29)
    at Object.exports.process (node_modules/jest-preset-coffeescript/index.js:17:36)
    at Generator.next (<anonymous>:null:null)
    at new Promise (<anonymous>:null:null)
    at Generator.next (<anonymous>:null:null)









    share|improve this question



























      0












      0








      0







      I am trying to add a test.coffee to a vue cli 3 generated project using jest-preset-coffeescript



      The error, not allowed to export objects, is from babel7 github issue not "liking" babel-preset-jest, babel7 is pulled in by @vue/cli-plugin-babel@3.1.1



      babel-preset-jest is pulled in by jest-preset-coffeescript



      UPDATE: found this issue: https://github.com/danielbayley/jest-preset-coffeescript/issues/1



          tests/test.coffee
      ● Test suite failed to run

      Plugin/Preset files are not allowed to export objects, only functions. In /Users/luntain/p/baz/node_modules/babel-preset-jest/index.js

      at createDescriptor (node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
      at items.map (node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
      at Array.map (<anonymous>:null:null)
      at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
      at createPresetDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
      at passPerPreset (node_modules/@babel/core/lib/config/config-descriptors.js:58:96)
      at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
      at presets.presets (node_modules/@babel/core/lib/config/config-descriptors.js:29:84)
      at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:320:26)
      at node_modules/@babel/core/lib/config/config-chain.js:283:7
      at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:68:29)
      at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)
      at loadFullConfig (node_modules/@babel/core/lib/config/full.js:43:39)
      at transformSync (node_modules/@babel/core/lib/transform.js:41:38)
      at Object.transform (node_modules/@babel/core/lib/transform.js:22:38)
      at CoffeeScript.transpile (node_modules/coffeescript/lib/coffeescript/index.js:30:18)
      at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:187:26)
      at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:54:19)
      at CoffeeScript.compile (node_modules/coffeescript/lib/coffeescript/index.js:45:29)
      at Object.exports.process (node_modules/jest-preset-coffeescript/index.js:17:36)
      at Generator.next (<anonymous>:null:null)
      at new Promise (<anonymous>:null:null)
      at Generator.next (<anonymous>:null:null)









      share|improve this question















      I am trying to add a test.coffee to a vue cli 3 generated project using jest-preset-coffeescript



      The error, not allowed to export objects, is from babel7 github issue not "liking" babel-preset-jest, babel7 is pulled in by @vue/cli-plugin-babel@3.1.1



      babel-preset-jest is pulled in by jest-preset-coffeescript



      UPDATE: found this issue: https://github.com/danielbayley/jest-preset-coffeescript/issues/1



          tests/test.coffee
      ● Test suite failed to run

      Plugin/Preset files are not allowed to export objects, only functions. In /Users/luntain/p/baz/node_modules/babel-preset-jest/index.js

      at createDescriptor (node_modules/@babel/core/lib/config/config-descriptors.js:178:11)
      at items.map (node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
      at Array.map (<anonymous>:null:null)
      at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
      at createPresetDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
      at passPerPreset (node_modules/@babel/core/lib/config/config-descriptors.js:58:96)
      at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
      at presets.presets (node_modules/@babel/core/lib/config/config-descriptors.js:29:84)
      at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:320:26)
      at node_modules/@babel/core/lib/config/config-chain.js:283:7
      at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:68:29)
      at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)
      at loadFullConfig (node_modules/@babel/core/lib/config/full.js:43:39)
      at transformSync (node_modules/@babel/core/lib/transform.js:41:38)
      at Object.transform (node_modules/@babel/core/lib/transform.js:22:38)
      at CoffeeScript.transpile (node_modules/coffeescript/lib/coffeescript/index.js:30:18)
      at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:187:26)
      at Object.<anonymous> (node_modules/coffeescript/lib/coffeescript/coffeescript.js:54:19)
      at CoffeeScript.compile (node_modules/coffeescript/lib/coffeescript/index.js:45:29)
      at Object.exports.process (node_modules/jest-preset-coffeescript/index.js:17:36)
      at Generator.next (<anonymous>:null:null)
      at new Promise (<anonymous>:null:null)
      at Generator.next (<anonymous>:null:null)






      jestjs babel vue-cli-3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 '18 at 20:42









      skyboyer

      3,33611128




      3,33611128










      asked Nov 19 '18 at 18:23









      luntainluntain

      2,39062945




      2,39062945
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380565%2fplugin-preset-files-are-not-allowed-to-export-objects-cant-get-jest-to-work-wi%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380565%2fplugin-preset-files-are-not-allowed-to-export-objects-cant-get-jest-to-work-wi%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          SQL update select statement

          'app-layout' is not a known element: how to share Component with different Modules