jest-cucumber icon indicating copy to clipboard operation
jest-cucumber copied to clipboard

Jest never stops, after tests were finished

Open normancarcamo opened this issue 4 years ago • 0 comments

Hi there, I have noticed that there's an issue after I run a test as simple as this:

The feature is this:

Feature: Upload file functionality

  I would be able to upload a dataset file in csv format 
  so that it can be stored into an in-memory database

  Scenario: User gets OK after file is uploaded
    Given a dataset file: files/autopromo.csv
    And provider name is: autopromo
    And columns are: vin,uuid,make,model,year
    When the file is uploaded
    Then the server responds with status 200

The step definitions is this:

import { defineFeature, loadFeature } from 'jest-cucumber';

const feature = 'test/integration/features/uploadFile.feature';
const uploadFileFeature = loadFeature(feature);

defineFeature(uploadFileFeature, (test) => {
  test('User gets OK after file is uploaded', ({ given, when, then, and }) => {
    given(/^a dataset file: (.*)$/, (file) => {
    });
    and(/^provider name is: (.*)$/, (provider) => {
    });
    and(/^columns are: (.*)$/, (columns) => {
    });
    when('the file is uploaded', () => {
    });
    then(/^the server responds with status (.*)$/, (status) => {
    });
  });
});

Then I have a npm script that runs the tests (And never stops, I'm not using neither watch argument): Screen Shot 2020-03-08 at 6 28 08 AM

And this is the jest configuration file I'm using:

// jest.config.integration.js
module.exports = {
  preset: "ts-jest",
  rootDir: ".",
  bail: true,
  verbose: true,
  collectCoverage: true,
  notify: true,
  expand: true,
  testURL: "http://localhost:3001/",
  coverageDirectory: "docs/test/coverage",
  testEnvironment: "node",
  setupFilesAfterEnv: [
    "./jest.setup.ts"
  ],
  moduleFileExtensions: [ "ts", "tsx", "js", "jsx", "json", "node" ],
  watchPathIgnorePatterns: ["node_modules"],
  testMatch: [
    "**/*.steps.ts"
  ],
  modulePaths: [
    "<rootDir>",
    "<rootDir>/src",
    "<rootDir>/test",
  ],
  reporters: [
    "default",
    ["./node_modules/jest-html-reporter", {
      includeFailureMsg: true,
      sort: "titleAsc",
      dateFormat: "dd-mm-yyyy HH:MM:ss",
      outputPath: "docs/test/report/integration-testing.html"
    }]
  ],
  coveragePathIgnorePatterns: [
    "<rootDir>/src/index"
  ],
  collectCoverageFrom: [
    "<rootDir>/src/*.(js|jsx|ts|tsx)"
  ],
  coverageDirectory: "docs/test/coverage/integration"
};

Any help?

normancarcamo avatar Mar 08 '20 12:03 normancarcamo