Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: hide the task in reported tasks
  • Loading branch information
sheremet-va committed Dec 10, 2024
commit 414c965d5180c40f6f9a8429487bd79c20842788
17 changes: 1 addition & 16 deletions docs/advanced/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@ class MyReporter implements Reporter {

```ts
declare class TestCase {
readonly type = 'test' | 'custom'
/**
* Task instance.
* @experimental Public task API is experimental and does not follow semver.
*/
readonly task: RunnerTestCase | RunnerCustomCase
readonly type = 'test'
/**
* The project associated with the test.
*/
Expand Down Expand Up @@ -236,11 +231,6 @@ export interface TestDiagnostic {
```ts
declare class TestSuite {
readonly type = 'suite'
/**
* Task instance.
* @experimental Public task API is experimental and does not follow semver.
*/
readonly task: RunnerTestSuite
/**
* The project associated with the test.
*/
Expand Down Expand Up @@ -286,11 +276,6 @@ declare class TestSuite {
```ts
declare class TestModule extends SuiteImplementation {
readonly type = 'module'
/**
* Task instance.
* @experimental Public task API is experimental and does not follow semver.
*/
readonly task: RunnerTestFile
/**
* Collection of suites and tests that are part of this module.
*/
Expand Down
12 changes: 11 additions & 1 deletion packages/vitest/src/node/reporters/reported-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { TestProject } from '../project'
class ReportedTaskImplementation {
/**
* Task instance.
* @experimental Public runner task API is experimental and does not follow semver.
* @internal
*/
public readonly task: RunnerTask

Expand All @@ -32,6 +32,7 @@ class ReportedTaskImplementation {
*/
public readonly location: { line: number; column: number } | undefined

/** @internal */
protected constructor(
task: RunnerTask,
project: TestProject,
Expand All @@ -44,6 +45,7 @@ class ReportedTaskImplementation {

/**
* Creates a new reported task instance and stores it in the project's state for future use.
* @internal
*/
static register(task: RunnerTask, project: TestProject) {
const state = new this(task, project) as TestCase | TestSuite | TestModule
Expand All @@ -55,6 +57,7 @@ class ReportedTaskImplementation {
export class TestCase extends ReportedTaskImplementation {
#fullName: string | undefined

/** @internal */
declare public readonly task: RunnerTestCase
public readonly type = 'test'

Expand All @@ -78,6 +81,7 @@ export class TestCase extends ReportedTaskImplementation {
*/
public readonly parent: TestSuite | TestModule

/** @internal */
protected constructor(task: RunnerTestCase, project: TestProject) {
super(task, project)

Expand Down Expand Up @@ -294,13 +298,15 @@ class TestCollection {
export type { TestCollection }

abstract class SuiteImplementation extends ReportedTaskImplementation {
/** @internal */
declare public readonly task: RunnerTestSuite | RunnerTestFile

/**
* Collection of suites and tests that are part of this suite.
*/
public readonly children: TestCollection

/** @internal */
protected constructor(task: RunnerTestSuite | RunnerTestFile, project: TestProject) {
super(task, project)
this.children = new TestCollection(task, project)
Expand All @@ -310,6 +316,7 @@ abstract class SuiteImplementation extends ReportedTaskImplementation {
export class TestSuite extends SuiteImplementation {
#fullName: string | undefined

/** @internal */
declare public readonly task: RunnerTestSuite
public readonly type = 'suite'

Expand All @@ -333,6 +340,7 @@ export class TestSuite extends SuiteImplementation {
*/
public readonly options: TaskOptions

/** @internal */
protected constructor(task: RunnerTestSuite, project: TestProject) {
super(task, project)

Expand Down Expand Up @@ -365,6 +373,7 @@ export class TestSuite extends SuiteImplementation {
}

export class TestModule extends SuiteImplementation {
/** @internal */
declare public readonly task: RunnerTestFile
declare public readonly location: undefined
public readonly type = 'module'
Expand All @@ -376,6 +385,7 @@ export class TestModule extends SuiteImplementation {
*/
public readonly moduleId: string

/** @internal */
protected constructor(task: RunnerTestFile, project: TestProject) {
super(task, project)
this.moduleId = task.filepath
Expand Down