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

TSConfig seemingly not used when passed in via angular's build options (see #23161) #23673

Closed
yusijs opened this issue Sep 2, 2022 · 4 comments
Assignees
Labels
CT Issue related to component testing npm: @cypress/angular @cypress/angular package issues

Comments

@yusijs
Copy link
Contributor

yusijs commented Sep 2, 2022

Current behavior

In #23161 we were allowed to pass in an Angular config object, which also includes a tsconfig-path. However, that tsconfig path seems to be fully ignored; if I pass in a random string, everything builds/tests as it should. I dug a bit through the code and looking at e.g

const tsConfigContent = JSON.stringify({
, it always uses /tsconfig.json.

Desired behavior

In my Angular / NX apps I have:

  • tsconfig.json (baseline)
  • tsconfig.app.json
  • tsconfig.jest.json
  • tsconfig.editor.json

I would also like to have a tsconfig.cypress.json to ensure the correct paths etc are used without having to interfere with the rest of my tsconfig-setup.

Test code to reproduce

// cypress.config.ts
export default defineConfig({
  component: {
    video: true,
    videosFolder: root + 'dist/cypress/components/videos',
    screenshotsFolder: root + 'dist/cypress/components/screenshots',
    devServer: {
      framework: 'angular',
      bundler: 'webpack',
      options: { // temporary, this will be done automatically when we get it directly from nx
        projectConfig: {
          root: projectRoot,
          sourceRoot: projectRoot + 'src',
          buildOptions: {
            tsConfig: _projectRoot + 'tsconfig.app.json',
            ... more config (that works yay)
          },
        }
      }
    },
    specPattern: 'cypress/specs/**/*.cy.ts',
  },
});

Cypress Version

10.7.0

Node version

v18.4.0 (also tried with 16.2.0)

Operating System

macOS 12.5

Debug Logs

No response

Other

No response

@lmiller1990 lmiller1990 added routed-to-ct npm: @cypress/angular @cypress/angular package issues CT Issue related to component testing labels Sep 7, 2022
@lmiller1990
Copy link
Contributor

Uh oh, regression - thanks for the reproduction. Knowing where it was introduced is really useful.

Are you interested in making a PR? If not I'll look for someone to pick it up internally.

@yusijs
Copy link
Contributor Author

yusijs commented Sep 7, 2022

Will make a pr for it - I wasn't 100% certain if I misunderstood and it was working as intended ™️.

Edit: pr -> #23696

@cypress-bot cypress-bot bot added the stage: needs review The PR code is done & tested, needs review label Sep 7, 2022
lmiller1990 pushed a commit that referenced this issue Sep 13, 2022
Falls back to tsconfig.json if one is not passed in
@cypress-bot cypress-bot bot removed stage: needs review The PR code is done & tested, needs review stage: contributor pr in progress labels Sep 13, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 13, 2022

The code for this is done in cypress-io/cypress#23696, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 27, 2022

Released in 10.9.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.9.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 27, 2022
lmiller1990 added a commit that referenced this issue Jan 24, 2023
* chore: release @cypress/angular-v1.1.0

[skip ci]

* chore: release @cypress/schematic-v2.1.0

[skip ci]

* chore: release @cypress/mount-utils-v2.1.0

[skip ci]

* chore: release @cypress/react-v6.2.0

[skip ci]

* chore: release @cypress/react18-v1.1.0

[skip ci]

* chore: release @cypress/svelte-v1.0.0

[skip ci]

* chore: release @cypress/vue-v4.2.0

[skip ci]

* chore: release @cypress/vue2-v1.1.0

[skip ci]

* chore: release @cypress/webpack-dev-server-v2.3.0

[skip ci]

* fix(cypress-schematic): suffix template files so they are not ignored (#23645)

* chore: release @cypress/schematic-v2.1.1

[skip ci]

* fix: Use tsconfig from build if exists (closes #23673) (#23696)

Falls back to tsconfig.json if one is not passed in

* feat: add support for generating angular component

* feat: skip default test generation

* feat: generate ct tests only if component was generated

* feat: add @cypress/schematic to schematicCollections

* feat: add documentation

* docs: document component generation

* add test

* fix generate from component with dir

* fix CI

* add variable to job defaults

* remove v13 support

Co-authored-by: Mike Plummer <mike-plummer@users.noreply.github.com>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: Zachary Williams <ZachJW34@gmail.com>
Co-authored-by: Ronnie Laugen <ronnie@rlaugen.no>
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
Co-authored-by: Jordan <jordan@jpdesigning.com>
Co-authored-by: Mark Noonan <mark@cypress.io>
Co-authored-by: astone123 <adams@cypress.io>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
Co-authored-by: Blue F <blue@cypress.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CT Issue related to component testing npm: @cypress/angular @cypress/angular package issues
Projects
None yet
Development

No branches or pull requests

2 participants