Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pa11y-runner-htmlcs

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pa11y-runner-htmlcs - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

4

CHANGELOG.md
# Changelog
## 0.2.0 (2018-05-24)
* Updates to match new Pa11y behaviour, returning element rather than selector and context
## 0.1.0 (2018-05-21)
* Initial release

5

lib/runner.js

@@ -28,3 +28,3 @@ 'use strict';

*/
runner.run = async (options, pa11y) => {
runner.run = async options => {

@@ -90,4 +90,3 @@ /**

type: issueTypeMap[issue.type] || 'unknown',
context: pa11y.getElementContext(issue.element),
selector: pa11y.getElementSelector(issue.element)
element: issue.element
};

@@ -94,0 +93,0 @@ }

{
"name": "pa11y-runner-htmlcs",
"version": "0.1.0",
"version": "0.2.0",
"description": "A HTML CodeSniffer runner for Pa11y",

@@ -5,0 +5,0 @@ "keywords": [

@@ -86,6 +86,3 @@ 'use strict';

};
pa11y = {
getElementContext: sinon.stub().returns('mock-element-context'),
getElementSelector: sinon.stub().returns('mock-element-selector')
};
pa11y = {};
resolvedValue = await runner.run(options, pa11y);

@@ -104,18 +101,2 @@ });

it('generates context for each issue element', () => {
assert.callCount(pa11y.getElementContext, 4);
assert.calledWithExactly(pa11y.getElementContext.getCall(0), 'mock-element-1');
assert.calledWithExactly(pa11y.getElementContext.getCall(1), 'mock-element-2');
assert.calledWithExactly(pa11y.getElementContext.getCall(2), 'mock-element-3');
assert.calledWithExactly(pa11y.getElementContext.getCall(3), 'mock-element-4');
});
it('generates selectors for each issue element', () => {
assert.callCount(pa11y.getElementSelector, 4);
assert.calledWithExactly(pa11y.getElementSelector.getCall(0), 'mock-element-1');
assert.calledWithExactly(pa11y.getElementSelector.getCall(1), 'mock-element-2');
assert.calledWithExactly(pa11y.getElementSelector.getCall(2), 'mock-element-3');
assert.calledWithExactly(pa11y.getElementSelector.getCall(3), 'mock-element-4');
});
it('resolves with processed and normalised issues', () => {

@@ -127,4 +108,3 @@ assert.deepEqual(resolvedValue, [

type: 'error',
context: 'mock-element-context',
selector: 'mock-element-selector'
element: 'mock-element-1'
},

@@ -135,4 +115,3 @@ {

type: 'warning',
context: 'mock-element-context',
selector: 'mock-element-selector'
element: 'mock-element-2'
},

@@ -143,4 +122,3 @@ {

type: 'notice',
context: 'mock-element-context',
selector: 'mock-element-selector'
element: 'mock-element-3'
},

@@ -151,4 +129,3 @@ {

type: 'unknown',
context: 'mock-element-context',
selector: 'mock-element-selector'
element: 'mock-element-4'
}

@@ -155,0 +132,0 @@ ]);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc