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

feat: prepare the Vitest API to be stable #6962

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
dd4f623
feat: prepare the Vitest API to be stable
sheremet-va Nov 25, 2024
250c4e4
chore: cleanup
sheremet-va Nov 25, 2024
a455c94
chore: add more type annotations, move globbing into a separate class
sheremet-va Nov 26, 2024
7f48a4b
chore: cleanup
sheremet-va Nov 26, 2024
414c965
feat: hide the task in reported tasks
sheremet-va Nov 26, 2024
de9e6e3
chore: fix types in tests
sheremet-va Nov 26, 2024
8749add
fix: fullName has file
sheremet-va Nov 26, 2024
b8830fb
refactor: remove the usage of getProjectByTaskId
sheremet-va Nov 26, 2024
32e0a95
refactor: move watcher functions into a separate class
sheremet-va Nov 26, 2024
2e2e701
chore: cleanup
sheremet-va Nov 26, 2024
e46b2b0
chore: get root
sheremet-va Nov 26, 2024
3b2c25f
chore: add ready() method
sheremet-va Nov 26, 2024
59dc0e7
chore: use fullName
sheremet-va Nov 26, 2024
4d414c8
fix: correctly print errors
sheremet-va Nov 26, 2024
4647988
chore: ignore typecheck error
sheremet-va Nov 26, 2024
fa62000
chore: make the rest into getters with a check
sheremet-va Nov 26, 2024
8a9f47c
fix: add a separate tsconfig for failing tests
sheremet-va Nov 26, 2024
0931b3c
refactor: add onFilterWatchedSpecification and getProvidedContext
sheremet-va Nov 26, 2024
66f79dd
chore: some docs
sheremet-va Nov 26, 2024
e23a4eb
docs: add more infor about test filtering
sheremet-va Dec 1, 2024
adaf11e
refactor: rename FileSpec to FileSpecification and Filter to FileFilter
sheremet-va Dec 1, 2024
d65953f
docs: restructure the sudebar, update TestRunResult type
sheremet-va Dec 2, 2024
38d12f3
perf: speed up getTestDependencies
sheremet-va Dec 3, 2024
3f31c8d
docs: more documented methods
sheremet-va Dec 3, 2024
e84f549
feat: add clearSpecificationsCache
sheremet-va Dec 3, 2024
c10df8a
docs: fix link
sheremet-va Dec 3, 2024
43b51e6
chore: cleanup
sheremet-va Dec 3, 2024
ce8733f
feat: add generateFileHash utility
sheremet-va Dec 3, 2024
27fc395
feat: allow --includeTaskLocation flag
sheremet-va Dec 3, 2024
e401be3
docs: document TestCase
sheremet-va Dec 3, 2024
d6017ca
docs: add task test api
sheremet-va Dec 3, 2024
bcf2c45
test: add tests for filters
sheremet-va Dec 3, 2024
bf4d32e
docs: cleanup
sheremet-va Dec 3, 2024
b150754
feat: add ok/skipped to test suite
sheremet-va Dec 3, 2024
cb0c7e7
chore: enable `includeTaskLocation` if Vitest received filters with :
sheremet-va Dec 3, 2024
e8cc0d2
test: disbale irrelevant tests
sheremet-va Dec 3, 2024
4af492b
chore: make hooks internal
sheremet-va Dec 3, 2024
59b08c8
chore: fix pnpm-lockfile
sheremet-va Dec 5, 2024
18c53b0
chore: keep exposing getCoreWorkspaceProject
sheremet-va Dec 6, 2024
f14b129
chore: 2.2 -> 3.0
sheremet-va Dec 6, 2024
cd5363b
chore: add experimental tag
sheremet-va Dec 6, 2024
c3e1ed5
feat: add .import method and hide the project.runner
sheremet-va Dec 6, 2024
c5c9a54
refactor: getRootTestProject -> getRootProject
sheremet-va Dec 6, 2024
0acc20b
feat: change source to () => source
sheremet-va Dec 6, 2024
c6e2833
docs: mention that the new task API is not used in the current API
sheremet-va Dec 6, 2024
54ba3e3
docs: add test spec docs
sheremet-va Dec 6, 2024
e111ab1
docs: cleanup
sheremet-va Dec 6, 2024
bd32b21
refactor: rename locations to testLines
sheremet-va Dec 6, 2024
253140c
fix: export TestSpecification only as a type
sheremet-va Dec 6, 2024
094e9a6
docs: update runner API docs
sheremet-va Dec 6, 2024
da7e999
refactor: deprecate ExtendedContext
sheremet-va Dec 6, 2024
e2598cc
refactor: remove deprecated APIs from custom-pool
sheremet-va Dec 6, 2024
1eaa705
refactor: remove deprecated APIs from sequencers
sheremet-va Dec 6, 2024
47e5484
docs: update pool docs
sheremet-va Dec 6, 2024
6c4030a
refactor: remove `ready` API
sheremet-va Dec 6, 2024
e9cf357
refactor: resolve workspace before reporters
sheremet-va Dec 6, 2024
693b23f
feat: expose `resolveConfig`
sheremet-va Dec 6, 2024
af73c51
docs: document `resolveConfig`
sheremet-va Dec 6, 2024
e09c25c
docs: document WorkspaceSpec type migration
sheremet-va Dec 6, 2024
104b80f
test: fix CI test fail
sheremet-va Dec 6, 2024
19fd6f2
fix: throw if --project doesn't exist, cleanup
sheremet-va Dec 6, 2024
a6c17a6
docs: finish docs
sheremet-va Dec 6, 2024
de8fa28
chore: automatically mark the test file as cached
sheremet-va Dec 6, 2024
90dad97
docs: add an example with watcher to guide
sheremet-va Dec 6, 2024
eed0e46
chore: review
sheremet-va Dec 9, 2024
f8a6e9b
docs: expose the selector string
sheremet-va Dec 9, 2024
491fc3c
docs: locator's selector
sheremet-va Dec 9, 2024
92f0f15
feat: unwrap locator into a string
sheremet-va Dec 9, 2024
085bf5b
docs: fix import
sheremet-va Dec 9, 2024
c5cbaa0
docs: remove old `start` method
sheremet-va Dec 10, 2024
c9e14c2
chore: fix deps
sheremet-va Dec 10, 2024
23602f0
chore: lint
sheremet-va Dec 10, 2024
2ad4d6f
docs: correction
sheremet-va Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 83 additions & 24 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { transformerNotationWordHighlight } from '@shikijs/transformers'
import { withPwa } from '@vite-pwa/vitepress'
import type { DefaultTheme } from 'vitepress'
import { defineConfig } from 'vitepress'
Expand Down Expand Up @@ -87,8 +88,9 @@ export default ({ mode }: { mode: string }) => {
dark: 'github-dark',
},
codeTransformers: mode === 'development'
? []
? [transformerNotationWordHighlight()]
: [
transformerNotationWordHighlight(),
transformerTwoslash({
processHoverInfo: (info) => {
if (info.includes(process.cwd())) {
Expand Down Expand Up @@ -146,7 +148,7 @@ export default ({ mode }: { mode: string }) => {
items: [
{
text: 'Advanced API',
link: '/advanced/api',
link: '/advanced/api/',
activeMatch: '^/advanced/',
},
{
Expand Down Expand Up @@ -243,16 +245,62 @@ export default ({ mode }: { mode: string }) => {
},
],
},
footer(),
{
items: [
...footer(),
{
text: 'Node API Reference',
link: '/advanced/api/',
},
],
},
],
'/advanced': [
{
text: 'API',
collapsed: false,
items: [
{
text: 'Vitest Node API',
link: '/advanced/api',
text: 'Node API',
items: [
{
text: 'Getting Started',
link: '/advanced/api/',
},
{
text: 'Vitest',
link: '/advanced/api/vitest',
},
{
text: 'TestProject',
link: '/advanced/api/test-project',
},
{
text: 'TestSpecification',
link: '/advanced/api/test-specification',
},
],
},
{
text: 'Test Task API',
items: [
{
text: 'TestCase',
link: '/advanced/api/test-case',
},
{
text: 'TestSuite',
link: '/advanced/api/test-suite',
},
{
text: 'TestModule',
link: '/advanced/api/test-module',
},
{
text: 'TestCollection',
link: '/advanced/api/test-collection',
},
],
},
{
text: 'Runner API',
Expand Down Expand Up @@ -282,7 +330,9 @@ export default ({ mode }: { mode: string }) => {
},
],
},
footer(),
{
items: footer(),
},
],
'/team': [],
'/': [
Expand All @@ -308,7 +358,7 @@ export default ({ mode }: { mode: string }) => {
link: '/guide/browser',
},
{
text: 'Advanced API',
text: 'Node API Reference',
link: '/advanced/api',
},
{
Expand All @@ -325,19 +375,17 @@ export default ({ mode }: { mode: string }) => {
}))
}

function footer(): DefaultTheme.SidebarItem {
return {
items: [
{
text: 'Config Reference',
link: '/config/',
},
{
text: 'Test API Reference',
link: '/api/',
},
],
}
function footer(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Config Reference',
link: '/config/',
},
{
text: 'Test API Reference',
link: '/api/',
},
]
}

function introduction(): DefaultTheme.SidebarItem[] {
Expand Down Expand Up @@ -423,14 +471,25 @@ function guide(): DefaultTheme.SidebarItem[] {
text: 'Debugging',
link: '/guide/debugging',
},
{
text: 'Migration Guide',
link: '/guide/migration',
},
{
text: 'Common Errors',
link: '/guide/common-errors',
},
{
text: 'Migration Guide',
link: '/guide/migration',
collapsed: false,
items: [
{
text: 'Migrating to Vitest 3.0',
link: '/guide/migration#vitest-3',
},
{
text: 'Migrating from Jest',
link: '/guide/migration#jest',
},
],
},
{
text: 'Performance',
collapsed: false,
Expand Down
6 changes: 6 additions & 0 deletions docs/.vitepress/style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,9 @@ img.resizable-img {
min-height: unset;
}
}

.highlighted-word {
background-color: var(--vp-code-line-highlight-color);
transition: background-color 0.5s;
display: inline-block;
}
Loading
Loading