0

Cypress seems to be incorrectly picking up my Jasmine spec files when running component tests:

enter image description here

enter image description here

I import the Account Service into my toolbar.component.cy.ts component so that I can add it to the providers array: enter image description here

This is the config for Cypress:

import { defineConfig } from "cypress";

export default defineConfig({
  component: {
    devServer: {
      framework: "angular",
      bundler: "webpack",
    },
    specPattern: "**/*.cy.ts",
  }
});

Has anyone else had this issue before? If so, how do you fix it?!

Pablo52
  • 41
  • 6
  • 1
    Out of curiosity, did you accidentally import the `account.service.spec.ts` file at the top of the `toolbar.component.cy.ts`? – DJSDev Feb 03 '23 at 03:55
  • 1
    Actually yes I have! Removing this import has resolved the issue. Thanks. If you add it as an answer, I will mark it as correct – Pablo52 Feb 03 '23 at 03:59

1 Answers1

1

Answered in a comment, but as we learned, it looks like you had the file imported at the top of your test file. :)

DJSDev
  • 812
  • 9
  • 18