type fixes (#2)

This commit is contained in:
Alex Schwartz 2025-02-21 19:47:00 -05:00 committed by GitHub
parent 0b5b2be88a
commit 1aebad3ffe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 4 deletions

View file

@ -109,6 +109,10 @@ Base directory for all relative paths used in the reporters.
- type: <[null]|[Object]>
- `total` <[int]> The total number of shards.
- `current` <[int]> The index of the shard to execute, one-based.
## property: FullConfig.skipAfterAnyFailure
* since: v1.51
- type: <[boolean]>
See [`property: TestConfig.shard`].

View file

@ -506,6 +506,9 @@ export default defineConfig({
});
```
## property: TestConfig.skipAfterAnyFailure?
* since: v1.51
- type: <[boolean]>
## property: TestConfig.testDir
* since: v1.10

View file

@ -49,7 +49,6 @@ export class FullConfigInternal {
readonly projects: FullProjectInternal[] = [];
readonly singleTSConfigPath?: string;
readonly populateGitInfo: boolean;
readonly skipAfterAnyFailure: boolean;
cliArgs: string[] = [];
cliGrep: string | undefined;
cliGrepInvert: string | undefined;
@ -88,8 +87,6 @@ export class FullConfigInternal {
// so that plugins such as gitCommitInfoPlugin can populate metadata once.
userConfig.metadata = userConfig.metadata || {};
this.skipAfterAnyFailure = userConfig.skipAfterAnyFailure ?? true;
this.config = {
configFile: resolvedConfigFile,
rootDir: pathResolve(configDir, userConfig.testDir) || configDir,
@ -108,6 +105,7 @@ export class FullConfigInternal {
quiet: takeFirst(configCLIOverrides.quiet, userConfig.quiet, false),
projects: [],
shard: takeFirst(configCLIOverrides.shard, userConfig.shard, null),
skipAfterAnyFailure: userConfig.skipAfterAnyFailure ?? true,
updateSnapshots: takeFirst(configCLIOverrides.updateSnapshots, userConfig.updateSnapshots, 'missing'),
updateSourceMethod: takeFirst(configCLIOverrides.updateSourceMethod, userConfig.updateSourceMethod, 'patch'),
version: require('../../package.json').version,

View file

@ -394,7 +394,7 @@ export class WorkerMain extends ProcessRunner {
const afterHooksTimeout = calculateMaxTimeout(this._project.project.timeout, testInfo.timeout);
const afterHooksSlot = { timeout: afterHooksTimeout, elapsed: 0 };
const FAILURE_AND_SkIP_NOW = testInfo._isFailure() && this._config.skipAfterAnyFailure;
const FAILURE_AND_SkIP_NOW = testInfo._isFailure() && this._config.config.skipAfterAnyFailure;
await testInfo._runAsStage({ title: 'After Hooks', stepInfo: { category: 'hook' } }, async () => {
let firstAfterHooksError: Error | undefined;

View file

@ -1949,6 +1949,8 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
current: number;
};
skipAfterAnyFailure: boolean;
/**
* See [testConfig.updateSnapshots](https://playwright.dev/docs/api/class-testconfig#test-config-update-snapshots).
*/