quasarframework / quasar-testing

Testing Harness App Extensions for the Quasar Framework 2.0+
https://testing.quasar.dev
MIT License
180 stars 65 forks source link

_quasarAppExtensionTestingUnitJest.mountFactory) is not a function #187

Closed khteh closed 2 years ago

khteh commented 2 years ago

There is symbol missing error from your '@quasar/quasar-app-extension-testing-unit-jest'. What do I miss from following your documentation https://testing.quasar.dev/packages/unit-jest/ ?

$ quasar test --unit jest
 App • Running "@quasar/testing" Quasar App Extension...
 App • Running "@quasar/testing" > "test" command

 RUN:  Running unit tests with jest

$ jest --ci
 PASS  test/jest/__tests__/MyButton.spec.js
 FAIL  test/pages/Fibonacci.test.js
  ● Test suite failed to run

    TypeError: (0 , _quasarAppExtensionTestingUnitJest.mountFactory) is not a function

      2 | import { QInput } from 'quasar'; // <= cherry pick only the components you actually use
      3 | import Fibonacci from '../../src/pages/Fibonacci'; // <= note the absence of `.vue` extension, here we are importing the JS/TS part of a Double File Component
    > 4 | const factory = mountFactory(Fibonacci, {
        |                 ^
      5 |   // mount: { type: 'full' } <= uncomment this line to use `mount`; `shallowMount` is used by default as it will stub all **registered** components found into the template
      6 |   quasar: { components: { QInput } },  
      7 |   mount: {

      at Object.<anonymous> (test/pages/Fibonacci.test.js:4:17)

Test Suites: 1 failed, 1 passed, 2 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        1.448 s
Ran all test suites.

Software version

OS: Ubuntu 21.10 Node: v16.11.1 NPM: 8.1.0 Any other software related to your bug:

What did you get as the error?

What were you expecting?

What steps did you take, to get the error?

IlCallo commented 2 years ago

Please check out the docs for Qv2-compatible AEs into next branch https://github.com/quasarframework/quasar-testing/tree/next