Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activating interactive snapshot mode results in "Your test suite must contain at least one test" #6431

Closed
dustinmartin opened this issue Jun 10, 2018 · 7 comments
Labels

Comments

@dustinmartin
Copy link

🐛 Bug Report

When I have snapshots that are failing, I enter i to begin interactive snapshot mode. Instead of beginning interactive snapshot mode, Jest reports "1 snapshot reviewed, 1 snapshot updated" when it hasn't actually updated the snapshots.

If I re-run Jest I see the same snapshots failing.

To Reproduce

yarn jest --config client/jest.config.js client/src/webapp/common/components/formatted-address/__tests__/formatted-address.spec.jsx --watch

I get this output:

screen shot 2018-06-10 at 2 29 02 pm

Notice the one snapshot failure. Once I enter i:

screen shot 2018-06-10 at 2 30 21 pm

I get the error Your test suite must contain at least one test.

Here is my Jest config.

module.exports = {
    testEnvironment: 'jsdom',
    testMatch: ['**/?(*.)(spec|test).js?(x)'],
    cacheDirectory: '../node_modules/.jest_client_cache',
    snapshotSerializers: ['enzyme-to-json/serializer'],
    roots: ['<rootDir>'],
    moduleNameMapper: {
        '.*\\.(css|less|styl|scss|sass)$':
            '<rootDir>/test/support/css-module.js'
    },
    transform: {
        '^.+\\.js$': 'babel-jest',
        '^.+\\.jsx$': 'babel-jest',
        '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
            '<rootDir>/test/support/file-transformer.js',
        '^.+\\.svg$': '<rootDir>/test/support/svg-transformer.js'
    },
    setupTestFrameworkScriptFile: '<rootDir>/test/support/suite-setup.js',
    clearMocks: true,
    resetModules: true,
    coverageDirectory: '../build-output/test-results/coverage',
    watchPlugins: [
        'jest-watch-typeahead/filename',
        'jest-watch-typeahead/testname'
    ]
};

Expected behavior

I'd expect interactive snapshot mode to work as detailed in the intro blog post: https://facebook.github.io/jest/blog/2018/05/29/jest-23-blazing-fast-delightful-testing.html#interactive-snapshot-mode

The error Your test suite must contain at least one test. seems to be preventing it from working.

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Binaries:
    Node: 8.9.4 - ~/.nvm/versions/node/v8.9.4/bin/node
    Yarn: 1.3.2 - /usr/local/bin/yarn
    npm: 5.10.0 - ~/Projects/work/cassi/node_modules/.bin/npm
  npmPackages:
    jest: ^23.1.0 => 23.1.0
@rickhanlonii
Copy link
Member

rickhanlonii commented Jun 14, 2018

v weird, any chance you can push a repo to repro?

@dustinmartin
Copy link
Author

Unfortunately the project is private and can't be shared. I'll try to reproduce it in a simplified project and push it up in the next several days.

@wcj3
Copy link

wcj3 commented Jun 22, 2018

@dustinmartin this is obviously not a long-term fix, but installing and uninstalling seemed to fix it.

@dustinmartin
Copy link
Author

@wcj3 Unfortunately that did not work. Thanks for the tip though.

@github-actions
Copy link

This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 17, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2023
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants