From adfd31a7aba4f41f53393a3a057bcdede3076d79 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Wed, 21 Aug 2013 17:11:09 +0200 Subject: [PATCH] refactor to check more HTML pages in mkws/examples/htdocs --- test/spec/mkws-index-full.spec.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/spec/mkws-index-full.spec.js b/test/spec/mkws-index-full.spec.js index 52c4eed..3627e14 100644 --- a/test/spec/mkws-index-full.spec.js +++ b/test/spec/mkws-index-full.spec.js @@ -34,7 +34,7 @@ function flat_list (list) { * */ -function html_check (file, tags_array) { +function html_check (file, tags_array, ignore_doctype) { var html = fs.readFileSync(file, "utf-8"); var tags = flat_list(tags_array); @@ -42,8 +42,11 @@ function html_check (file, tags_array) { it("html test", function() { expect(html).toBeDefined(); - expect(html).toMatch(//); // forgotten doctype? - expect(html).toMatch(/<\/html.*?>/); + // forgotten doctype declaration + if (!ignore_doctype) { + expect(html).toMatch(//); + expect(html).toMatch(/<\/html.*?>/); + } expect(html).toMatch(//); expect(html).toMatch(//); expect(html).toMatch(/<\/head.*?>/); @@ -51,7 +54,7 @@ function html_check (file, tags_array) { expect(html).toMatch(/.+<\/title>/i); - expect(html).toMatch(/