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

Open
6 tasks done
hi-ogawa opened this issue Oct 11, 2024 · 1 comment
Open
6 tasks done

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

hi-ogawa opened this issue Oct 11, 2024 · 1 comment
Labels
p2-to-be-discussed Enhancement under consideration (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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-to-be-discussed Enhancement under consideration (priority)
Projects
Status: P2 - 3
Development

No branches or pull requests

2 participants