public icon indicating copy to clipboard operation
public copied to clipboard

Ability to pass config options on start?

Open IPWright83 opened this issue 3 months ago • 2 comments

Issue description or question

I try to run WallabyJS in smart watch mode, but often miss files that I didn't realise were testing things that CI picks up. To counter that I sometimes run Wallaby on the whole project however it feels pretty slow at this point. Some timings:

Wallaby: 185s
npm run test: 135s // "test": "jest"
npm run test (optimised): 25s // "test": "jest --changedSince origin/master" 

It'd be really nice if it were possible to create "configurations" so I could choose between Smart Start/Start/Custom, so that I can use the --changedSince. Failing that an option to pass --changedSince overall to modify the behaviour of Start would be useful.

This would help speed up Wallaby on first start and avoid missing failing tests.

IPWright83 avatar Oct 07 '25 09:10 IPWright83

Thank you for submitting the feature request.

Re: provided timings

Wallaby: 185s
npm run test: 135s

The discrepancy is definitely unexpected. We are keen to investigate it, can you please

  • check if your npm run test command collects code coverage,
  • provide your Jest config file,
  • provide Wallaby diagnostics report for the full initial run on the project.

ArtemGovorov avatar Oct 08 '25 02:10 ArtemGovorov

So npm run test is simply running "jest --changedSince origin/master" so there's no coverage in there. Obviously I dropped the --changedSince for one of those timings.

Jest.config.js

module.exports = {
  globals: {
    __DEV__: true,
    __APPSHA__: 'testing',
  },
  globalSetup: './test/jest-global-setup.mjs',
  setupFiles: ['./test/jest-setup.js', 'jest-launchdarkly-mock'],
  setupFilesAfterEnv: ['./test/jest-setup-after-env.js'],
  snapshotSerializers: ['enzyme-to-json/serializer'],
  snapshotFormat: {
    escapeString: true,
    printBasicPrototype: true,
  },
  moduleNameMapper: {
    '^@UI(.*)$': '<rootDir>/src/ui$1',
    '^@Tracking(.*)$': '<rootDir>/src/tracking$1',
    '^@Hooks(.*)$': '<rootDir>/src/hooks$1',
    '^@Lib(.*)$': '<rootDir>/src/lib$1',
    '^@HOC(.*)$': '<rootDir>/src/hoc$1',
    '^@Components(.*)$': '<rootDir>/src/components$1',
    '^@Generated(.*)$': '<rootDir>/src/generated$1',
    '/vendors/pusher$': '<rootDir>/test/fake-pusher.js',
    '^vendors(.*)$': '<rootDir>/vendors$1',
    '^dnd-core$': 'dnd-core/dist/cjs',
    '^react-dnd$': 'react-dnd/dist/cjs',
    '^react$': '<rootDir>/node_modules/react',
    '^react-dom$': '<rootDir>/node_modules/react-dom',
    '^react-dnd-html5-backend$': 'react-dnd-html5-backend/dist/cjs',
    '^react-dnd-touch-backend$': 'react-dnd-touch-backend/dist/cjs',
    '^react-dnd-test-backend$': 'react-dnd-test-backend/dist/cjs',
    '^react-dnd-test-utils$': 'react-dnd-test-utils/dist/cjs',
    '^uuid$': '<rootDir>/node_modules/uuid',
    '^test$': '<rootDir>/test/index.js',
    '^test/(.*)$': '<rootDir>/test/$1',
    '\\.(eot|otf|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
      '<rootDir>/test/file-mock.js',
    '\\.(css|less|scss)$': 'identity-obj-proxy',
  },
  roots: ['<rootDir>/src', '<rootDir>/outer-sharing-frame'],
  transform: {
    '\\.[jt]sx?$': 'babel-jest',
    '\\.(gql|graphql)$': '<rootDir>/test/jest-transform-graphql.js',
    '\\.svg': '<rootDir>/test/jest-transform-svg.js',
    '\\.(jpg|jpeg|png|gif|webp)$': 'jest-transform-stub',
  },
  clearMocks: true,
  restoreMocks: true,
  testRegex: '\\.test\\.[jt]sx?$',
  coverageDirectory: './coverage-jest/',
  coverageReporters: ['json', 'lcov'],
  coveragePathIgnorePatterns: [
    '/node_modules/',
    '/test/',
    '.graphql$',
    'src/universal/test/describe-sync.js',
  ],
  testPathIgnorePatterns: ['/templates/'],
  testEnvironment: 'jsdom',
  workerIdleMemoryLimit: '1.6GiB',
};

wallaby3.txt

IPWright83 avatar Oct 08 '25 09:10 IPWright83