• Maintainer

    A note on asynchronous tests

    Some tests are implemented using setTimeout to wait until promises are resolved. In some cases, this is necessary and you should follow the recommendation of replacing setTimeout with setImmediate. In other cases, the promises that need to be resolved come axios HTTP requests. For those cases you can wait for promise resolution using return axios.waitForAll();.

     describe('successful request', () => {
        beforeEach(() => {
          mockEnvironments(environmentsList);
          createWrapper();
          return axios.waitForAll();
        });
    
        it('should render a table with environments', () => {
          const table = wrapper.find(EnvironmentTable);
    
          expect(table.exists()).toBe(true);
          expect(table.find('.environment-name').text()).toEqual(environmentsList[0].name);
        });
     });
  • Author Contributor

    @ealcantara updated the setTimeout section. Thanks for bringing this up!

  • I’d been reading up on some history stuff and wanted something lighter to do after all that thinking. Went searching for a site with some fun games to switch gears. Checked out Casino Kingdom and it’s got a neat mix of slots and table games I enjoyed. From New Zealand, they offer things like a welcome bonus and free spins, so I played around with different options without worrying about the cost.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment