Skip to content

Commit

Permalink
Merge pull request #298 from ember-a11y/fix-ts-duplicate-identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
scalvert committed Oct 18, 2021
2 parents e0a450a + 31a302a commit dff095f
Show file tree
Hide file tree
Showing 8 changed files with 2,493 additions and 3,195 deletions.
8 changes: 5 additions & 3 deletions addon-test-support/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ function logHtml(node: NodeResult | RelatedNode): void {
function logFailureMessage(node: NodeResult, key: AxeCoreNodeResultKey): void {
// this exists on axe but we don't export it as part of the typescript
// namespace, so just let me use it as I need
const message: string = ((axeCore as unknown) as AxeWithAudit)._audit.data.failureSummaries[
key
].failureMessage(node[key].map((check) => check.message || ''));
const message: string = (
axeCore as unknown as AxeWithAudit
)._audit.data.failureSummaries[key].failureMessage(
node[key].map((check) => check.message || '')
);

console.error(message);
}
Expand Down
12 changes: 12 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ module.exports = async function () {
{
name: 'ember-release',
npm: {
dependencies: {
'ember-auto-import': '^2.2.0',
webpack: '^5.0.0',
},
devDependencies: {
'ember-source': await getChannelURL('release'),
},
Expand All @@ -70,6 +74,10 @@ module.exports = async function () {
{
name: 'ember-beta',
npm: {
dependencies: {
'ember-auto-import': '^2.2.0',
webpack: '^5.0.0',
},
devDependencies: {
'ember-source': await getChannelURL('beta'),
},
Expand All @@ -78,6 +86,10 @@ module.exports = async function () {
{
name: 'ember-canary',
npm: {
dependencies: {
'ember-auto-import': '^2.2.0',
webpack: '^5.0.0',
},
devDependencies: {
'ember-source': await getChannelURL('canary'),
},
Expand Down
27 changes: 14 additions & 13 deletions node-tests/setup-middleware-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@ QUnit.module('setupMiddleware', function (hooks) {
server.close();
});

QUnit.test('can respond to requests to report violations', async function (
assert
) {
let data = [buildResult(violationsFixture)];
QUnit.test(
'can respond to requests to report violations',
async function (assert) {
let data = [buildResult(violationsFixture)];

let json = await fetch('http://localhost:3000/report-violations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then((res) => res.json());
let json = await fetch('http://localhost:3000/report-violations', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then((res) => res.json());

assert.deepEqual(readJSONSync(json.outputPath), data);
});
assert.deepEqual(readJSONSync(json.outputPath), data);
}
);
});
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"lint:ts": "tsc --noEmit",
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test:node": "qunit node-tests",
Expand Down Expand Up @@ -132,6 +133,9 @@
"tokenRef": "GITHUB_AUTH"
}
},
"resolutions": {
"socket.io": "^4.3.1"
},
"contributors": [
"Trent Willis <[email protected]>",
"Andrew A Lee <[email protected]>",
Expand Down Expand Up @@ -164,4 +168,4 @@
"node": "12.22.1",
"yarn": "1.22.10"
}
}
}
27 changes: 14 additions & 13 deletions tests/acceptance/setup-global-a11y-hooks-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,24 @@ module('setupGlobalA11yHooks with invokeAll', function (hooks) {
});

getRange(TEST_INVOCATIONS_COUNT).forEach((num) => {
test(getTestName(num, TEST_INVOCATIONS_COUNT, 'invokeAll'), async function (
assert
) {
assert.expect(0);
test(
getTestName(num, TEST_INVOCATIONS_COUNT, 'invokeAll'),
async function (assert) {
assert.expect(0);

await visit('/');
await visit('/');

numInvoked++;
numInvoked++;

if (numInvoked === TEST_INVOCATIONS_COUNT) {
assert.expect(1);
assert.equal(
actualAuditInvocationsCount,
EXPECTED_AUDIT_INVOCATIONS_COUNT
);
if (numInvoked === TEST_INVOCATIONS_COUNT) {
assert.expect(1);
assert.equal(
actualAuditInvocationsCount,
EXPECTED_AUDIT_INVOCATIONS_COUNT
);
}
}
});
);
});
});

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/format-violation-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ module('Unit | Utils | formatViolation', function () {
],
};

let expected = /formatViolation called with improper structure of parameter: violation. Required properties: impact, help, helpUrl./;
let expected =
/formatViolation called with improper structure of parameter: violation. Required properties: impact, help, helpUrl./;

assert.throws(function () {
formatViolation(violation, [violation.nodes[0].html]);
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"alwaysStrict": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
Loading

0 comments on commit dff095f

Please sign in to comment.