Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions packages/cli/src/bin/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import http from 'http';
import net from 'net';
import path from 'path';
import fs from 'fs';
import execa from 'execa';
import { version } from '../../package.json';
import runCLI from '../testutils/';

Expand Down Expand Up @@ -146,9 +147,10 @@ describe('cli', () => {
try {
await runCLI(`file://${SIMPLE_HTML_FILE}`, '--exit');
} catch (error) {
assert.equal(error.exitCode, 1);
const err = error as execa.ExecaReturnBase<string>;
assert.equal(err.exitCode, 1);
assert.include(
error.stdout,
err.stdout,
'Violation of "marquee" with 1 occurrences!'
);
}
Expand All @@ -158,9 +160,10 @@ describe('cli', () => {
try {
await runCLI(`file://${SIMPLE_CLEAN_HTML_FILE}`, '--exit');
} catch (error) {
assert.equal(error.exitCode, 0);
const err = error as execa.ExecaReturnBase<string>;
assert.equal(err.exitCode, 0);
assert.include(
error.stdout,
err.stdout,
'Violation of "marquee" with 1 occurrences!'
);
}
Expand Down Expand Up @@ -382,9 +385,10 @@ describe('cli', () => {
try {
await runCLI(`file://${SIMPLE_HTML_FILE}`, '--timeout', '0');
} catch (error) {
assert.notEqual(error.exitCode, 0);
const err = error as execa.ExecaReturnBase<string>;
assert.notEqual(err.exitCode, 0);
assert.include(
error.stderr,
err.stderr,
'An error occurred while testing this page.'
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/lib/axe-test-urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const testPages = async (
events?.startTimer('axe-core execution time');
}

axe.analyze((err: Error | null, results: AxeResults) => {
axe.analyze((err, results) => {
if (config.timer) {
events?.endTimer('axe-core execution time');
}
Expand All @@ -83,7 +83,7 @@ const testPages = async (
}

// Move to the next item
testPages(urls.slice(1), config, events).then((out: AxeResults) => {
testPages(urls.slice(1), config, events).then(out => {
resolve([results].concat(out));
});
});
Expand Down
16 changes: 4 additions & 12 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node"],
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"strictNullChecks": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"lib": ["dom", "ES2015", "esnext.asynciterable"],
"module": "commonjs",
"outDir": "./dist/",
"target": "ES2015",
"allowJs": true,
"lib": ["dom", "ES2015", "esnext.asynciterable"],
"esModuleInterop": true,
"skipLibCheck": true,
"declaration": true
"types": ["node"]
},
"include": ["./src/lib", "./src/bin"]
}
1 change: 1 addition & 0 deletions packages/playwright/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ export default class AxeBuilder {
if (result.length > sizeLimit) {
return await chunkResults(result.substr(sizeLimit));
}
return;
}

await chunkResults(partialString);
Expand Down
1 change: 1 addition & 0 deletions packages/puppeteer/src/axePuppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export class AxePuppeteer {
if (result.length > sizeLimit) {
return await chunkResults(result.substr(sizeLimit));
}
return;
}

await chunkResults(partialString);
Expand Down
21 changes: 2 additions & 19 deletions packages/puppeteer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
/* Basic Options */
"target": "esnext",
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"lib": [
"dom",
"esnext"
] /* Specify library files to be included in the compilation. */,
"declaration": true /* Generates corresponding '.d.ts' file. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
"outDir": "dist" /* Redirect output structure to the directory. */,
"rootDir": "src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
"removeComments": true /* Do not emit comments to output. */,
"pretty": true,
"strict": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"moduleResolution": "node",
"esModuleInterop": true
"module": "commonjs"
},
"include": ["src"]
}
1 change: 1 addition & 0 deletions packages/webdriverio/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export const axeFinishRun = (
if (result.length > sizeLimit) {
return chunkResults(result.substr(sizeLimit));
}
return;
});
}

Expand Down
1 change: 1 addition & 0 deletions packages/webdriverjs/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function axeFinishRun(
if (result.length > sizeLimit) {
return chunkResults(result.substr(sizeLimit));
}
return;
});
}

Expand Down
3 changes: 1 addition & 2 deletions packages/webdriverjs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export interface AxeInjectorParams extends Options {
}

export type CallbackFunction = (
error: Error | null,
results: AxeResults | null
...args: [Error, null] | [null, AxeResults]
) => void;

export type InjectCallback = (err?: Error) => void;
Expand Down
27 changes: 18 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
{
"compilerOptions": {
"moduleResolution": "node",
"target": "esnext",
"module": "esnext",
"allowJs": true,
"declaration": true,
"esModuleInterop": true,
"lib": ["dom", "esnext"],
"strict": true,
"module": "esnext",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"outDir": "dist",
"pretty": true,
"removeComments": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"declaration": true,
"outDir": "dist",
"esModuleInterop": true,
"resolveJsonModule": true
"strict": true,
"strictNullChecks": true,
"target": "esnext"
Comment on lines +3 to +20
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for putting these in alphabetical order!

},
"exclude": ["**/*.test.ts", "**/test/**/*.ts"],
"ts-node": {
"compilerOptions": {
"module": "commonjs",
"target": "es5"
"target": "es5",
"removeComments": false
}
}
}