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

Should vi.setConfig({ sequence: { concurrent: true } }) work? #6684

Closed
6 tasks done
hi-ogawa opened this issue Oct 11, 2024 · 1 comment · Fixed by #6880
Closed
6 tasks done

Should vi.setConfig({ sequence: { concurrent: true } }) work? #6684

hi-ogawa opened this issue Oct 11, 2024 · 1 comment · Fixed by #6880
Labels
p1-chore Doesn't change code behavior (priority)

Comments

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Oct 11, 2024

Describe the bug

Docs now mentions it's not supported https://vitest.dev/api/vi.html#vi-setconfig But it's available as typing of vi.setConfig.

vitest/docs/api/vi.md

Lines 977 to 980 in 2a50464

sequence: {
hooks: 'stack'
// supports only "sequence.hooks"
}

But it might be a regression and possible to make it work again #6653 (comment)

If not, we should update RuntimeConfig to hide it from typing.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-opxrtz?file=repro.test.ts

(based on tests from #6652)

System Info

(stackblitz)

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitest/ui: 2.1.2 => 2.1.2 
    vite: latest => 5.4.8 
    vitest: 2.1.2 => 2.1.2

Used Package Manager

npm

Validations

@sheremet-va
Copy link
Member

sheremet-va commented Oct 14, 2024

Conceptually, I don't see why it wouldn't work:

vi.setConfig({ sequence: { concurrent: true } })
describe('suite1') // concurrent
describe('suite2') // concurrent
describe('suite3', { concurrent: false }) // sequential

The question is here, I guess:

describe('suite1', () => {
  vi.setConfig({ sequence: { concurrent: true } })
  describe('suite2') // should it inherit parent suite options or follow global config?
})

@sheremet-va sheremet-va added p2-to-be-discussed Enhancement under consideration (priority) and removed pending triage labels Oct 16, 2024
@sheremet-va sheremet-va moved this to P2 - 3 in Team Board Oct 16, 2024
@sheremet-va sheremet-va moved this from P2 - 3 to Rejected in Team Board Nov 7, 2024
sheremet-va added a commit to sheremet-va/vitest that referenced this issue Nov 7, 2024
@sheremet-va sheremet-va added p1-chore Doesn't change code behavior (priority) and removed p2-to-be-discussed Enhancement under consideration (priority) labels Nov 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p1-chore Doesn't change code behavior (priority)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants