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

[wallabyjs] add new configuration options #68864

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 35 additions & 3 deletions types/wallabyjs/index.d.ts
Expand Up @@ -307,6 +307,18 @@ declare module "wallabyjs" {
* @defaultValue `false`
*/
preservePaths?: boolean | undefined;

/**
* If `true`, makes node test runner symlink local node modules from
* Wallaby cache to correctly support ES modules resolution
*/
symlinkNodeModules?: boolean | undefined;

/**
* If `true`, Willaby will not add new lines between test messages or
* test errors in Wallaby output.
*/
compactMessageOutput?: boolean | undefined;
}

/**
Expand Down Expand Up @@ -537,6 +549,11 @@ declare module "wallabyjs" {
* @defaultValue `true`
*/
load?: boolean | undefined;

/**
* Treat this file as a binary file
*/
binary?: boolean | undefined
}

/**
Expand Down Expand Up @@ -615,13 +632,28 @@ declare module "wallabyjs" {
/**
* Wallaby worker configuration.
*
* recycle - Specifies the degree of parallelism used to run your tests and
* controls the way wallaby re-uses workers.
*
* @see {@link https://wallabyjs.com/docs/config/workers.html} for details.
*/
export interface IWallabyWorkers {
/**
* May be an alias for {@link restart}
*/
recycle?: boolean | undefined;

/**
* If `true`, Wallaby will restart workers instead of reusing processes
*/
restart?: boolean | undefined;

/**
* Initial number of parallel processes to run your tests on start
*/
initial?: number;

/**
* Number of parallel processes to run your tests on code change
*/
regular?: number;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion types/wallabyjs/wallabyjs-tests.ts
Expand Up @@ -22,7 +22,7 @@ export class WallabyConfig implements wallabyjs.IWallabyConfig {

public tests: Array<string | wallabyjs.IWallabyFilePattern> = [
"src/**/*.spec.ts",
{ pattern: "src/**/*.css", instrument: false, load: true },
{ pattern: "src/**/*.css", instrument: false, load: true, binary: true },
];

public compilers: wallabyjs.IWallabyCompilers = {
Expand Down Expand Up @@ -115,5 +115,12 @@ export class WallabyConfig implements wallabyjs.IWallabyConfig {
},
};

public workers = {
recycle: true,
restart: true,
initial: 6,
regular: 2
}

constructor(private readonly wallaby: wallabyjs.IWallaby) {}
}