Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
tombui99 committed Dec 6, 2023
1 parent c7d1b30 commit f20b418
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha test/link-scanning/**/*.js"
"test": "mocha"
},
"author": "",
"license": "ISC",
Expand Down
10 changes: 5 additions & 5 deletions docker/test/link-scanning/codeauditor-test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ const { runBrokenLinkCheck, readCsv } = require("../../utils")
const { htmlHintConfig, fetchHtml } = require("../../api");
const { addCustomHtmlRule } = require("../../customHtmlRules");

let testUrls = "http://127.0.0.1:5001/sswlinkauditor-c1131/asia-east2/api/testing/randomizeHtmlPages/content";
let testUrls = "https://asia-east2-sswlinkauditor-c1131.cloudfunctions.net/api/testing/randomizeHtmlPages/content";

before(async () => {
await addCustomHtmlRule();
});

describe(`Test CodeAuditor Run`, () => {
it('Test CodeAuditor run', async () => {
// Scanning broken links
// Test Scanning links
const [result, error] = runBrokenLinkCheck(testUrls);
if (error) {
console.log(`Error scanning broken links: ${error}`);
}
const scanResults = await readCsv("./all_links.csv");

// Check HTML Errors/Warnings
// Test Checking HTML Errors/Warnings
let html = await fetchHtml(testUrls);
const htmlHintResult = HTMLHint.verify(html, htmlHintConfig);

expect(scanResults.length).not.to.be(0);
expect(htmlHintResult.length).not.to.be(0);
expect(scanResults.length).to.be(5);
expect(htmlHintResult.length).to.be(21);
}).timeout(10000)
})

0 comments on commit f20b418

Please sign in to comment.