jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
43.84k stars 6.39k forks source link

[Bug]: when adding "disctributed" to a testfile name it no longer runs #15142

Open BramZwart01 opened 1 week ago

BramZwart01 commented 1 week ago

Version

29.7.0

Steps to reproduce

Make a project with the same jest version as me, make a working test and name it "something.requester.spec.ts", and add this jest config file:

  testPathIgnorePatterns: ['./node_modules', './dist', './mocks'],
  globalSetup: './jest.global.ts',
  transform: {
    '^.+\\.ts$': 'ts-jest',
  },
  coverageDirectory: './coverage/unit',
  coverageReporters: ['json', 'cobertura', 'text', 'lcov'],
  moduleFileExtensions: ['js', 'json', 'ts', 'node'],
  reporters: ['default', 'jest-junit'],
  testEnvironment: 'node',
  collectCoverage: true,
  collectCoverageFrom: [
    './src/**/*.ts',
    '!./src/main\\.ts',
    '!./src/**/*.model.ts',
    '!./src/**/*.dto.ts',
    '!./src/**/*.type.ts',
    '!./src/**/*.enum.ts',
    '!./src/**/*.module.ts',
    '!./src/**/*.interface.ts',
    '!./src/**/*.decorator.ts',
    '!./src/**/*.args.ts',
    '!./src/**/*.enum.ts',
    '!./src/error/types/*.ts',
    // Currently not testable
    '!./src/**/sentry-error.interceptor.ts',
    '!./src/data-source/aem/graphql/shared/*.ts',
  ],
  coverageThreshold: {
    global: {
      branches: 90,
      functions: 90,
      lines: 90,
      statements: 90,
    },
  },
};

After making the test working, change the name to "distributed.requester.spec.ts", for me and my colleages the test no longer works

Expected behavior

I expect the previously working test to still work

Actual behavior

No tests found, exiting with code 1 Run with --passWithNoTests to exit with code 0 No files found in [file location] Make sure Jest's configuration does not exclude this directory. To set up Jest, make sure a package.json file exists. Jest Documentation: https://jestjs.io/docs/configuration Files: "tests/schema/account/resolvers/distributed.resolver.spec.ts"

Process finished with exit code 1

Additional context

No response

Environment

System:
    OS: macOS 14.5
    CPU: (12) arm64 Apple M3 Pro
  Binaries:
    Node: 21.5.0 - /opt/homebrew/bin/node
    npm: 10.8.1 - ~/Documents/triple-git/legacy/vfz-one-app-api/node_modules/.bin/npm
  npmPackages:
    jest: 29.7.0 => 29.7.0