@qualweb/earl-reporter
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -11,2 +11,36 @@ 'use strict'; | ||
const best_practices_reporter_1 = __importDefault(require("./lib/best-practices.reporter")); | ||
const context = { | ||
'@context': { | ||
'@vocab': 'http://www.w3.org/ns/earl#', | ||
'earl': 'http://www.w3.org/ns/earl#', | ||
'WCAG20': 'http://www.w3.org/TR/WCAG20/#', | ||
'WCAG21': 'http://www.w3.org/TR/WCAG21/#', | ||
'dct': 'http://purl.org/dc/terms/', | ||
'sch': 'https://schema.org/', | ||
'doap': 'http://usefulinc.com/ns/doap#', | ||
'foaf': 'http://xmlns.com/foaf/0.1/', | ||
'WebPage': 'sch:WebPage', | ||
'url': 'dct:source', | ||
'source': 'dct:source', | ||
'redirectedTo': 'dct:source', | ||
'assertions': { | ||
'@reverse': 'subject' | ||
}, | ||
'assertedBy': { | ||
'@type': '@id' | ||
}, | ||
'outcome': { | ||
'@type': '@id' | ||
}, | ||
'mode': { | ||
'@type': '@id' | ||
}, | ||
'pointer': { | ||
'@type': 'ptr:CSSSelectorPointer' | ||
}, | ||
'title': { | ||
'@type': 'dct:title' | ||
} | ||
} | ||
}; | ||
async function generateEARLAssertions(report, date) { | ||
@@ -48,3 +82,3 @@ switch (report.type) { | ||
const earlReport = { | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@context': context, | ||
'@graph': new Array() | ||
@@ -98,3 +132,3 @@ }; | ||
const aggregatedReport = { | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@context': context, | ||
'@graph': new Array() | ||
@@ -101,0 +135,0 @@ }; |
{ | ||
"name": "@qualweb/earl-reporter", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Qualweb earl reporter", | ||
@@ -28,5 +28,5 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@qualweb/types": "^0.3.1", | ||
"@qualweb/types": "^0.3.2", | ||
"@types/lodash.clonedeep": "^4.5.6", | ||
"@types/node": "^12.11.1", | ||
"@types/node": "^12.12.25", | ||
"chai": "^4.2.0", | ||
@@ -33,0 +33,0 @@ "mocha": "^6.2.1", |
@@ -7,3 +7,4 @@ 'use strict'; | ||
Report, | ||
EarlReport, | ||
EarlReport, | ||
EarlContext, | ||
TestSubject, | ||
@@ -20,2 +21,37 @@ Assertor, | ||
const context: EarlContext = { | ||
'@context': { | ||
'@vocab': 'http://www.w3.org/ns/earl#', | ||
'earl': 'http://www.w3.org/ns/earl#', | ||
'WCAG20': 'http://www.w3.org/TR/WCAG20/#', | ||
'WCAG21': 'http://www.w3.org/TR/WCAG21/#', | ||
'dct': 'http://purl.org/dc/terms/', | ||
'sch': 'https://schema.org/', | ||
'doap': 'http://usefulinc.com/ns/doap#', | ||
'foaf': 'http://xmlns.com/foaf/0.1/', | ||
'WebPage': 'sch:WebPage', | ||
'url': 'dct:source', | ||
'source': 'dct:source', | ||
'redirectedTo': 'dct:source', | ||
'assertions': { | ||
'@reverse': 'subject' | ||
}, | ||
'assertedBy': { | ||
'@type': '@id' | ||
}, | ||
'outcome': { | ||
'@type': '@id' | ||
}, | ||
'mode': { | ||
'@type': '@id' | ||
}, | ||
'pointer': { | ||
'@type': 'ptr:CSSSelectorPointer' | ||
}, | ||
'title': { | ||
'@type': 'dct:title' | ||
} | ||
} | ||
}; | ||
async function generateEARLAssertions(report: Report, date?: string): Promise<Assertion[]> { | ||
@@ -58,3 +94,3 @@ switch(report.type) { | ||
const earlReport: EarlReport = { | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@context': context, | ||
'@graph': new Array<TestSubject>() | ||
@@ -115,3 +151,3 @@ }; | ||
const aggregatedReport: EarlReport = { | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@context': context, | ||
'@graph': new Array<TestSubject>() | ||
@@ -118,0 +154,0 @@ }; |
Sorry, the diff of this file is not supported yet
77882
1695