@qualweb/earl-reporter
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -47,4 +47,4 @@ 'use strict'; | ||
const earlReport = { | ||
context: 'https://act-rules.github.io/earl-context.json', | ||
graph: new Array() | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@graph': new Array() | ||
}; | ||
@@ -61,6 +61,9 @@ const assertor = { | ||
'@type': 'TestSubject', | ||
source: report.system.url.completeUrl, | ||
source: report.system.url.inputUrl, | ||
assertor, | ||
assertions: new Array() | ||
}; | ||
if (report.system.url.inputUrl !== report.system.url.completeUrl) { | ||
testSubject.redirectedTo = report.system.url.completeUrl; | ||
} | ||
if (report.modules['act-rules'] && reportModule('act', options)) { | ||
@@ -90,3 +93,3 @@ testSubject.assertions = [ | ||
} | ||
earlReport.graph.push(lodash_clonedeep_1.default(testSubject)); | ||
earlReport['@graph'].push(lodash_clonedeep_1.default(testSubject)); | ||
return earlReport; | ||
@@ -96,8 +99,8 @@ } | ||
const aggregatedReport = { | ||
context: 'https://act-rules.github.io/earl-context.json', | ||
graph: new Array() | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@graph': new Array() | ||
}; | ||
for (const report of reports || []) { | ||
const earlReport = await generateSingleEarlReport(report, options); | ||
aggregatedReport.graph.push(lodash_clonedeep_1.default(earlReport.graph[0])); | ||
aggregatedReport['@graph'].push(lodash_clonedeep_1.default(earlReport['@graph'][0])); | ||
} | ||
@@ -104,0 +107,0 @@ return aggregatedReport; |
{ | ||
"name": "@qualweb/earl-reporter", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Qualweb earl reporter", | ||
@@ -28,3 +28,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@qualweb/types": "^0.2.15", | ||
"@qualweb/types": "^0.3.1", | ||
"@types/lodash.clonedeep": "^4.5.6", | ||
@@ -37,3 +37,3 @@ "@types/node": "^12.11.1", | ||
"tslint": "^5.20.0", | ||
"typescript": "^3.6.4" | ||
"typescript": "^3.7.5" | ||
}, | ||
@@ -40,0 +40,0 @@ "dependencies": { |
@@ -56,4 +56,4 @@ 'use strict'; | ||
const earlReport: EarlReport = { | ||
context: 'https://act-rules.github.io/earl-context.json', | ||
graph: new Array<TestSubject>() | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@graph': new Array<TestSubject>() | ||
}; | ||
@@ -72,3 +72,3 @@ | ||
'@type': 'TestSubject', | ||
source: report.system.url.completeUrl, | ||
source: report.system.url.inputUrl, | ||
assertor, | ||
@@ -78,2 +78,6 @@ assertions: new Array<Assertion>() | ||
if (report.system.url.inputUrl !== report.system.url.completeUrl) { | ||
testSubject.redirectedTo = report.system.url.completeUrl; | ||
} | ||
if (report.modules['act-rules'] && reportModule('act', options)) { | ||
@@ -104,3 +108,3 @@ testSubject.assertions = [ | ||
earlReport.graph.push(cloneDeep(testSubject)); | ||
earlReport['@graph'].push(cloneDeep(testSubject)); | ||
@@ -112,4 +116,4 @@ return earlReport; | ||
const aggregatedReport: EarlReport = { | ||
context: 'https://act-rules.github.io/earl-context.json', | ||
graph: new Array<TestSubject>() | ||
'@context': 'https://act-rules.github.io/earl-context.json', | ||
'@graph': new Array<TestSubject>() | ||
}; | ||
@@ -119,3 +123,3 @@ | ||
const earlReport = await generateSingleEarlReport(report, options); | ||
aggregatedReport.graph.push(cloneDeep(earlReport.graph[0])); | ||
aggregatedReport['@graph'].push(cloneDeep(earlReport['@graph'][0])); | ||
} | ||
@@ -122,0 +126,0 @@ |
@@ -272,16 +272,16 @@ const { expect } = require('chai'); | ||
const earl = await reporter.generateEARLReport([evaluationReport], { modules: { act: true }}); | ||
expect(earl[0].graph[0].assertions.length).to.not.be.equal(0); | ||
expect(earl[0]['@graph'][0].assertions.length).to.not.be.equal(0); | ||
}); | ||
it('Should report act module 2', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport], {}); | ||
expect(earl[0].graph[0].assertions.length).to.not.be.equal(0); | ||
expect(earl[0]['@graph'][0].assertions.length).to.not.be.equal(0); | ||
}); | ||
it('Should report act module 3', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions.length).to.not.be.equal(0); | ||
expect(earl[0]['@graph'][0].assertions.length).to.not.be.equal(0); | ||
}); | ||
it('Should not report act module', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport], { modules: { act: false }}); | ||
expect(earl[0].graph[0].assertions.length).to.be.equal(0); | ||
expect(earl[0]['@graph'][0].assertions.length).to.be.equal(0); | ||
}); | ||
}); |
@@ -274,7 +274,7 @@ const { expect } = require('chai'); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0])).to.be.an('array').and.to.include('context'); | ||
expect(Object.keys(earl[0])).to.be.an('array').and.to.include('@context'); | ||
}); | ||
it('should not be empty', async function () { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].context.trim()).to.be.not.equal(''); | ||
expect(earl[0]['@context'].trim()).to.be.not.equal(''); | ||
}); | ||
@@ -284,3 +284,3 @@ it('should be valid', async function () { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
const contextUrl = earl[0].context.trim(); | ||
const contextUrl = earl[0]['@context'].trim(); | ||
const options = { | ||
@@ -300,15 +300,15 @@ method: 'GET', | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0])).to.be.an('array').and.to.include('graph'); | ||
expect(Object.keys(earl[0])).to.be.an('array').and.to.include('@graph'); | ||
}); | ||
it('should be of type array', async function () { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph).to.be.an('array'); | ||
expect(earl[0]['@graph']).to.be.an('array'); | ||
}); | ||
it('should not be empty', async function () { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph.length).to.be.not.equal(0); | ||
expect(earl[0]['@graph'].length).to.be.not.equal(0); | ||
}); | ||
it('should have only one test subject', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph.length).to.be.equal(1); | ||
expect(earl[0]['@graph'].length).to.be.equal(1); | ||
}); | ||
@@ -319,15 +319,15 @@ describe('"Test subject" field', function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0])).to.be.an('array').and.to.include('@type'); | ||
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('@type'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0]['@type']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0]['@type']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0]['@type'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0]['@type'].trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "TestSubject"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0]['@type'].trim()).to.be.equal('TestSubject'); | ||
expect(earl[0]['@graph'][0]['@type'].trim()).to.be.equal('TestSubject'); | ||
}); | ||
@@ -338,11 +338,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0])).to.be.an('array').and.to.include('source'); | ||
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('source'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0]['source']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0]['source']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0]['source'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0]['source'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -353,3 +353,3 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0])).to.be.an('array').and.to.include('assertor'); | ||
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('assertor'); | ||
}) | ||
@@ -359,11 +359,11 @@ describe('"@id" field', function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertor)).to.be.an('array').and.to.include('@id'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('@id'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['@id']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertor['@id']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['@id'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertor['@id'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -374,15 +374,15 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertor)).to.be.an('array').and.to.include('@type'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('@type'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['@type']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertor['@type']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['@type'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertor['@type'].trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "Software"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['@type'].trim()).to.be.equal('Software'); | ||
expect(earl[0]['@graph'][0].assertor['@type'].trim()).to.be.equal('Software'); | ||
}); | ||
@@ -393,11 +393,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertor)).to.be.an('array').and.to.include('title'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('title'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['title']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertor['title']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['title'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertor['title'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -408,11 +408,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertor)).to.be.an('array').and.to.include('description'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('description'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['description']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertor['description']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['description'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertor['description'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -423,11 +423,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertor)).to.be.an('array').and.to.include('hasVersion'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('hasVersion'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['hasVersion']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertor['hasVersion']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['hasVersion'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertor['hasVersion'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -438,11 +438,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertor)).to.be.an('array').and.to.include('homepage'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('homepage'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['homepage']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertor['homepage']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertor['homepage'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertor['homepage'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -454,11 +454,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0])).to.be.an('array').and.to.include('assertions'); | ||
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('assertions'); | ||
}); | ||
it('should be of type array', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions).to.be.an('array'); | ||
expect(earl[0]['@graph'][0].assertions).to.be.an('array'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions.length).to.not.be.equal(0); | ||
expect(earl[0]['@graph'][0].assertions.length).to.not.be.equal(0); | ||
}); | ||
@@ -470,3 +470,3 @@ it('should have number of assertions equal to the same amount of tests done', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions.length).to.be.equal(nAssertions); | ||
expect(earl[0]['@graph'][0].assertions.length).to.be.equal(nAssertions); | ||
}); | ||
@@ -477,15 +477,15 @@ describe('"assertion" field', function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0])).to.include('@type'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('@type'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0]['@type']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0]['@type']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0]['@type'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0]['@type'].trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "Assertion"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0]['@type'].trim()).to.be.equal('Assertion'); | ||
expect(earl[0]['@graph'][0].assertions[0]['@type'].trim()).to.be.equal('Assertion'); | ||
}); | ||
@@ -496,3 +496,3 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0])).to.include('test'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('test'); | ||
}); | ||
@@ -502,11 +502,11 @@ describe('"@id" field', function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].test)).to.include('@id'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('@id'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['@id']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].test['@id']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['@id'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].test['@id'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -517,15 +517,15 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].test)).to.include('@type'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('@type'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['@type']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].test['@type']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['@type'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].test['@type'].trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "TestCase"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['@type'].trim()).to.be.equal('TestCase'); | ||
expect(earl[0]['@graph'][0].assertions[0].test['@type'].trim()).to.be.equal('TestCase'); | ||
}); | ||
@@ -536,11 +536,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].test)).to.include('title'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('title'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['title']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].test['title']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['title'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].test['title'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -551,11 +551,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].test)).to.include('description'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('description'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['description']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].test['description']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].test['description'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].test['description'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -567,15 +567,15 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0])).to.include('mode'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('mode'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0]['mode']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0]['mode']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0]['mode'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0]['mode'].trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "earl:automatic"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0]['mode'].trim()).to.be.equal('earl:automatic'); | ||
expect(earl[0]['@graph'][0].assertions[0]['mode'].trim()).to.be.equal('earl:automatic'); | ||
}); | ||
@@ -586,3 +586,3 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0])).to.include('result'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('result'); | ||
}); | ||
@@ -592,15 +592,15 @@ describe('"@type" field', function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result)).to.include('@type'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('@type'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['@type']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].result['@type']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['@type'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].result['@type'].trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "TestCase"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['@type'].trim()).to.be.equal('TestResult'); | ||
expect(earl[0]['@graph'][0].assertions[0].result['@type'].trim()).to.be.equal('TestResult'); | ||
}); | ||
@@ -611,15 +611,15 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result)).to.include('outcome'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('outcome'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['outcome']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].result['outcome']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['outcome'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].result['outcome'].trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "earl:passed" or "earl:failed" or "earl:inapplicable"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(['earl:passed', 'earl:failed', 'earl:inapplicable']).to.include(earl[0].graph[0].assertions[0].result['outcome'].trim()); | ||
expect(['earl:passed', 'earl:failed', 'earl:inapplicable']).to.include(earl[0]['@graph'][0].assertions[0].result['outcome'].trim()); | ||
}); | ||
@@ -630,3 +630,3 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result)).to.include('source'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('source'); | ||
}); | ||
@@ -636,3 +636,3 @@ describe('"result" field', function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result.source[0])).to.include('result'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result.source[0])).to.include('result'); | ||
}); | ||
@@ -642,11 +642,11 @@ describe('"pointer" field', function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result.source[0].result)).to.include('pointer'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result.source[0].result)).to.include('pointer'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result.source[0].result.pointer).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.pointer).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result.source[0].result.pointer.trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.pointer.trim()).to.not.be.equal(''); | ||
}); | ||
@@ -657,15 +657,15 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result.source[0].result)).to.include('outcome'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result.source[0].result)).to.include('outcome'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result.source[0].result.outcome).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.outcome).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result.source[0].result.outcome.trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.outcome.trim()).to.not.be.equal(''); | ||
}); | ||
it('should be "earl:passed" or "earl:failed" or "earl:inapplicable"', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(['earl:passed', 'earl:failed', 'earl:inapplicable']).to.include(earl[0].graph[0].assertions[0].result.source[0].result.outcome.trim()); | ||
expect(['earl:passed', 'earl:failed', 'earl:inapplicable']).to.include(earl[0]['@graph'][0].assertions[0].result.source[0].result.outcome.trim()); | ||
}); | ||
@@ -678,11 +678,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result)).to.include('description'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('description'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['description']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].result['description']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['description'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].result['description'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -693,11 +693,11 @@ }); | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(Object.keys(earl[0].graph[0].assertions[0].result)).to.include('date'); | ||
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('date'); | ||
}); | ||
it('should be of type string', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['date']).to.be.a('string'); | ||
expect(earl[0]['@graph'][0].assertions[0].result['date']).to.be.a('string'); | ||
}); | ||
it('should not be empty', async function() { | ||
const earl = await reporter.generateEARLReport([evaluationReport]); | ||
expect(earl[0].graph[0].assertions[0].result['date'].trim()).to.not.be.equal(''); | ||
expect(earl[0]['@graph'][0].assertions[0].result['date'].trim()).to.not.be.equal(''); | ||
}); | ||
@@ -704,0 +704,0 @@ }); |
Sorry, the diff of this file is not supported yet
76219
1626