No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Tags
    3. test
    Log in to post
    • G

      Unit Testing - How to mock $q.platform.is.[...]?
      Help • jest platform test testing vue-test-utils • • geddy

      2
      0
      Votes
      2
      Posts
      517
      Views

      G

      Fixed my own issue.

      I created a computed property - isDesktop() - that returns “this.$q.platform.is.desktop”. Then within my test file, I dynamically updated the computed property that then allowed me to test the functionality.

      I defined a factory function that is then called in beforeEach().

      const factory = (computed = { }) => {
      return shallowMount(App, {
      computed
      });
      };

      beforeEach(() => {
      wrapper = factory();
      });

      For the test that requires the updated computer property, I then called the factory function and set the computed property value.

      it(‘my amazing test’, () => {
      wrapper = factory({
      isDesktop: () => false
      });

      expect(addYourAssertionHere)
      })

    • M

      Integration with Testing Library
      Framework • test testing • • Matheus Ryuki

      6
      0
      Votes
      6
      Posts
      520
      Views

      A

      Hi all,
      I’m still struggling with the test setup.
      Issue:
      “[Vue warn]: Unknown custom element: <q-breadcrumbs> - did you register the component correctly? For recursive components, make sure to provide the “name” option.”
      I’m not able to set
      " localVue.use(Quasar);"
      which is the clue when using vue test-utils.
      But the render function of the vue testing-library creates the “localVue” instance internally.
      Any hints ?
      Andreas

    • A

      Unit testing a component with QPageSticky
      Help • qpagesticky test • • arfarf

      1
      0
      Votes
      1
      Posts
      416
      Views

      No one has replied

    • Jezzta667

      Why is there no webpack alias to src by default?
      Framework • cli test • • Jezzta667

      6
      0
      Votes
      6
      Posts
      1480
      Views

      dmitry.polushkin

      It’s possible to use webpack with IDEA IDE: https://www.jetbrains.com/help/idea/using-webpack.html
      Just set separate webpack.js file and include it into the quasar.conf.js

    • Jezzta667

      @quasar/testing with Jest does not print location of failed tests (stack trace)
      CLI • jest test • • Jezzta667

      5
      1
      Votes
      5
      Posts
      554
      Views

      Jezzta667

      @nothingismagick You guys are doing such an awesome job addressing all the issues cropping up. I can imagine you’re working your butts off. It’s very much appreciated.

    • Jezzta667

      console.log() not allowed in Jest tests
      CLI • eslint jest test • • Jezzta667

      4
      0
      Votes
      4
      Posts
      4776
      Views

      Jezzta667

      @nothingismagick thank you for your help. I suspect I must have had case-matching turned on during the search for that line of code, so apologies for the silly question.

      I would be happy to forego console.log() and begin using the Chrome debugger but I have been unable to get this to work with Quasar. I have tried the following:

      Add debugger statement to the test code Run the tests using yarn test:unit:debug Navigate to ‘chrome://inspect’ Click on the ‘inspect’ link for Remote Target: jest file:///

      New Chrome window opens with:

      Uncaught Error: Cannot find module '<my-project-folder>\jest'

      A guide to accessing debugging would be a great addition to the Quasar Testing documentation. 🙂

    • Jezzta667

      Unit Test a Quasar Dialog
      Framework • dialog jest qdialog test vue-test-utils • • Jezzta667

      4
      0
      Votes
      4
      Posts
      1227
      Views

      G

      could you please tell me how to test the opening and closing of the dialog ?

    • G

      Build for environments other than 'development" and 'production'
      Framework • build development environment production test • • gtissington

      9
      0
      Votes
      9
      Posts
      5826
      Views

      A

      Hi sorry, I’m not sure whether this has been marked as resolved or not.

      Seems like I have same concern:
      So there will be 3 different environments (e.g: dev, staging, production).
      It will also have 3 different API url. (how to set these three up without using dot-env ext which failed in Amplify readability)
      It will have 3 different build commands.

      which one should I do first and how?