-
Notifications
You must be signed in to change notification settings - Fork 28
Conversation
…x-builder into e2e-accessibility
Codecov Report
@@ Coverage Diff @@
## master #250 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 54 56 +2
Lines 1265 1305 +40
Branches 190 195 +5
=====================================
+ Hits 1265 1305 +40
Continue to review full report at Codecov.
|
…x-builder into e2e-accessibility
@@ -0,0 +1,2 @@ | |||
const analyzer = require('../../../lib/a11y-analyzer'); | |||
module.exports = { SkyA11y: analyzer }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is essentially an adaptor to meet the NodeJS requirements to stub out protractor
and axe-webdriverjs
in the unit tests, and our consuming SPAs requirement to import a TypeScript class. (See the definition file, above.)
@Blackbaud-BobbyEarl: To answer the question: "What’s the reasoning for the source being JavaScript and having a matching The main reason the source is in JavaScript is to make stubbing out the various modules possible in the unit test. Since the source file requires
I did originally write this feature using pure TypeScript, and it worked in the consuming e2e tests just fine. The issue came when I had to write unit tests for it on the Builder side of things. Stubbing out the JS modules just seemed to be impossible. Also keep in mind that this script is technically NOT a runtime feature, as it's not getting consumed by an Angular application. It's literally a server-side script. To see what I'm talking about, try writing a unit test for the sibling file, |
Hey @Blackbaud-SteveBrush. Thanks for clarifying for me. I'm not a huge fan of having to give up TS as the source, but I understand the limitations. While it kind of feels like a weird setup, I'm not sure I have a suggestion on a better approach. For the sake of time, the only thing I could think to do would be to leave the source in Typescript, and test the functionality in an Unless @Blackbaud-PaulCrowder has any additional opinions, I'm ok with this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the empty beforeEach
, I think this is the best course of action to keep the feature moving.
test/config-axe.spec.js
Outdated
|
||
describe('config axe', () => { | ||
beforeEach(() => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty beforeEach
Or, all rules can be disabled via:
A full list of rules can be found here: https://github.com/dequelabs/axe-core/blob/master/doc/rule-descriptions.md
Addresses: blackbaud/skyux2#590
@Blackbaud-MattGregg This should be quite similar to what you originally submitted. I had to change a few things because of the way unit tests are handled, currently.