From bebc13ea5b1babb1bfe55d7f4ff138da7196b3ef Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 20:46:25 -0700 Subject: [PATCH 1/5] [cypress-axe] update types for v0.4.0 --- types/cypress-axe/index.d.ts | 6 ++++-- types/cypress-axe/package.json | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 types/cypress-axe/package.json diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 507a5f773d..8231c364be 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -1,12 +1,14 @@ -// Type definitions for cypress-axe 0.3 +// Type definitions for cypress-axe 0.4 // Project: https://github.com/avanslaars/cypress-axe#readme // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +import { ElementContext, RunOptions } from 'axe-core'; declare namespace Cypress { interface Chainable { injectAxe(): void; - checkA11y(): void; + checkA11y(context?: ElementContext, options?: RunOptions): void; + configureAxe(options?: RunOptions): void; } } diff --git a/types/cypress-axe/package.json b/types/cypress-axe/package.json new file mode 100644 index 0000000000..71df6dd355 --- /dev/null +++ b/types/cypress-axe/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "axe-core": "^3.1.2" + } +} From 1b05c90543db62948cc508199160b9e9c4a134b8 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 21:25:29 -0700 Subject: [PATCH 2/5] [cypress-axe] augment axe-core's Node type --- types/cypress-axe/index.d.ts | 5 +++++ types/cypress-axe/tslint.json | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 8231c364be..c2158fd5ec 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -3,8 +3,13 @@ // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 + import { ElementContext, RunOptions } from 'axe-core'; +declare module "axe-core" { + interface Node {} +} + declare namespace Cypress { interface Chainable { injectAxe(): void; diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json index 3db14f85ea..4f44991c3c 100644 --- a/types/cypress-axe/tslint.json +++ b/types/cypress-axe/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false + } +} From 6d45563a4a6a896d2c1075bc50b3458500c5a529 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 22:50:39 -0700 Subject: [PATCH 3/5] [cypress-axe] switch to inline import() to reference axe-core types --- types/cypress-axe/index.d.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index c2158fd5ec..628ba66397 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -4,16 +4,13 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import { ElementContext, RunOptions } from 'axe-core'; - -declare module "axe-core" { - interface Node {} -} - declare namespace Cypress { interface Chainable { injectAxe(): void; - checkA11y(context?: ElementContext, options?: RunOptions): void; - configureAxe(options?: RunOptions): void; + checkA11y( + context?: import('axe-core').ElementContext, + options?: import('axe-core').RunOptions, + ): void; + configureAxe(options?: import('axe-core').RunOptions): void; } } From ed9e9089ca8977534278547934572e6e6006367f Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sat, 2 Mar 2019 22:57:34 -0700 Subject: [PATCH 4/5] [cypress-axe] reference dom lib and require TypeScript 3.1 --- types/cypress-axe/index.d.ts | 4 +++- types/cypress-axe/tslint.json | 7 +------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 628ba66397..10fc76e9f5 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -2,7 +2,9 @@ // Project: https://github.com/avanslaars/cypress-axe#readme // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 3.1 + +/// declare namespace Cypress { interface Chainable { diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json index 4f44991c3c..3db14f85ea 100644 --- a/types/cypress-axe/tslint.json +++ b/types/cypress-axe/tslint.json @@ -1,6 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-empty-interface": false - } -} +{ "extends": "dtslint/dt.json" } From 1136cb28a384d483bfe0eabca24e4c8e6417e918 Mon Sep 17 00:00:00 2001 From: Justin Hall Date: Sun, 3 Mar 2019 19:06:56 -0700 Subject: [PATCH 5/5] [cypress-axe] fix all the things --- types/cypress-axe/index.d.ts | 23 +++++++++++++---------- types/cypress-axe/tslint.json | 7 ++++++- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts index 10fc76e9f5..3ba776e14f 100644 --- a/types/cypress-axe/index.d.ts +++ b/types/cypress-axe/index.d.ts @@ -2,17 +2,20 @@ // Project: https://github.com/avanslaars/cypress-axe#readme // Definitions by: Justin Hall // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.1 +// TypeScript Version: 2.3 -/// +import { ElementContext, RunOptions } from 'axe-core'; -declare namespace Cypress { - interface Chainable { - injectAxe(): void; - checkA11y( - context?: import('axe-core').ElementContext, - options?: import('axe-core').RunOptions, - ): void; - configureAxe(options?: import('axe-core').RunOptions): void; +declare module 'axe-core' { + interface Node {} +} + +declare global { + namespace Cypress { + interface Chainable { + injectAxe(): void; + checkA11y(context?: ElementContext, options?: RunOptions): void; + configureAxe(options?: RunOptions): void; + } } } diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json index 3db14f85ea..4f44991c3c 100644 --- a/types/cypress-axe/tslint.json +++ b/types/cypress-axe/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-empty-interface": false + } +}