-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): make spec into a class instead of a tuple (#6355)
- Loading branch information
1 parent
e03683c
commit 874a121
Showing
12 changed files
with
134 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import type { TestProject } from './reported-workspace-project' | ||
import type { Pool } from './types/pool-options' | ||
import type { WorkspaceProject } from './workspace' | ||
|
||
export class WorkspaceSpec { | ||
// backwards compatibility | ||
/** | ||
* @deprecated | ||
*/ | ||
public readonly 0: WorkspaceProject | ||
/** | ||
* @deprecated | ||
*/ | ||
public readonly 1: string | ||
/** | ||
* @deprecated | ||
*/ | ||
public readonly 2: { pool: Pool } | ||
|
||
public readonly project: TestProject | ||
public readonly moduleId: string | ||
public readonly pool: Pool | ||
// public readonly location: WorkspaceSpecLocation | undefined | ||
|
||
constructor( | ||
workspaceProject: WorkspaceProject, | ||
moduleId: string, | ||
pool: Pool, | ||
// location?: WorkspaceSpecLocation | undefined, | ||
) { | ||
this[0] = workspaceProject | ||
this[1] = moduleId | ||
this[2] = { pool } | ||
this.project = workspaceProject.testProject | ||
this.moduleId = moduleId | ||
this.pool = pool | ||
// this.location = location | ||
} | ||
|
||
/** | ||
* for backwards compatibility | ||
* @deprecated | ||
*/ | ||
*[Symbol.iterator]() { | ||
yield this.project.workspaceProject | ||
yield this.moduleId | ||
yield this.pool | ||
} | ||
} | ||
|
||
// interface WorkspaceSpecLocation { | ||
// start: number | ||
// end: number | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters