Closed Raza403 closed 10 months ago
@fulldecent please check, now we have one file doing both tests. The reason for having
const actualMessages = report.results.length === 0
? []
: report.results[0].messages;
const hasExpectedMessage = actualMessages.some(
(actualMessage) =>
actualMessage.ruleId === messages[0].ruleId &&
actualMessage.message === messages[0].message
);
is because there are some extra properties in actual
.
Expected:
[
{
"ruleId": "pacific-medical-training/no-jquery",
"severity": 2,
"message": "script tag with src including jQuery",
"size": 0,
"selector": null,
"ruleUrl": "https://github.com/fulldecent/github-pages-template/"
}
]
Actual:
[
{
"ruleId": "pacific-medical-training/no-jquery",
"severity": 2,
"message": "script tag with src including jQuery",
"offset": 242,
"line": 8,
"column": 6,
"size": 6,
"selector": "html > head > script"
}
]
I would request your review again please.
@Raza403 Please check out main branch. Everything is implemented with the new .mjs (ESM) format for the new html-validate.
A test for
no-jquery
was added. Test will pass if/test/fixtures/no-jquery.html
has a jquery script tag, otherwise the test will fail. This PR is made for #50