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

Impossible to start Cypress tests. Stuck on test bootstrap. #30762

Open
Nikitzu opened this issue Dec 13, 2024 · 0 comments
Open

Impossible to start Cypress tests. Stuck on test bootstrap. #30762

Nikitzu opened this issue Dec 13, 2024 · 0 comments

Comments

@Nikitzu
Copy link

Nikitzu commented Dec 13, 2024

Current behavior

I cannot run any test(even empty one). Cypress shows "Your tests are loading" and this message never goes awaya.

Desired behavior

I want to be able to run tests

Test code to reproduce

I installed:

{
  "@cypress/react": "^8.0.2",
  "@types/cypress": "^1.1.6",
  "cypress": "^13.16.1",
}

I use vite+TS+React in my app. Here is vite-config.ts

import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import mkcert from 'vite-plugin-mkcert';
import tsconfigPaths from 'vite-tsconfig-paths';
import { version } from './package.json';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), tsconfigPaths(), mkcert()],
  assetsInclude: ['**/*.woff'],
  define: {
    APP_VERSION: JSON.stringify(version),
  },
});

cypress-config.ts:

import { defineConfig } from 'cypress';

export default defineConfig({
  component: {
    devServer: {
      framework: 'react',
      bundler: 'vite',
    },
  },
});

I have empty cypress/support/component.ts file. And two simple test examples:

// empty
describe('test.cy.tsx', () => {
  it('playground', () => {
    // cy.mount()
  })
})

// button
import { mount } from 'cypress/react';
import Button from '@/button';

describe('<Button />', () => {
  it('renders with the correct label', () => {
    mount(<Button />);
    cy.get('button').contains('Click Me');
  });
});

Button test is based on this component:

const Button = () => (<button>{'Click'}</button>)
export default Button;

That is all. And yet this setup fails even to start running the tests. Instead I see this after running npx cypress open:
image

Cypress Version

13.16.1

Node version

v18.20.4

Operating System

Sequoia 15.1.1

Debug Logs

No response

Other

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant