carbon-design-system / carbon-components-vue

Vue implementation of the Carbon Design System
http://vue.carbondesignsystem.com
Apache License 2.0
604 stars 178 forks source link

Problems with CarbonVue, Jest and @carbon/icons-vue #1102

Open LeoValadares opened 3 years ago

LeoValadares commented 3 years ago

Detailed description

Unable to run Jest any tests on default vue-cli project with carbon-vue and carbon icons. We were only able to run the jest tests when all the imports for carbon icons were commented out. Here is the error in question that prevents our tests from running:

FAIL tests/unit/CompanyInfo.spec.js
  ● Test suite failed to run

    /Users/leovaladares/rf-calculator/node_modules/@carbon/icons-vue/es/trash-can/20.js:9
    import { _ as _objectSpread2, a as _defineProperty } from '../_rollupPluginBabelHelpers-d91f8aa7.js';
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module

      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
      at src/components/QuotationProductsTable.vue:1573:50
      at Object.<anonymous> (src/components/QuotationProductsTable.vue:1739:3)

The command used to run the test:

Leonardos-MacBook-Pro-2:rf-calculator$ /usr/bin/env CI=vscode-jest-tests /usr/local/bin/node --inspect-brk=19684 node_modules/jest/bin/jest.js --runInBand CompanyInfo.spec.js --testNamePattern "company name field validation"

github-actions[bot] commented 1 month ago

This issue has been marked as stale because it has required additional info or a response from the author for over 14 days. When you get the chance, please comment with the additional info requested. Otherwise, this issue will be closed in 14 days.