From 0bdc44826d83d048015a601d25a5cf337cc0c961 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 15 Apr 2020 11:07:20 +0200 Subject: [PATCH] unify all markdown tests into one file --- gulpfile.js | 14 +- test/test-markdown-element-attributes.html | 176 ---------- test/test-markdown-external.html | 49 --- test/test-markdown-options.html | 65 ---- test/test-markdown-slide-attributes.html | 172 ---------- test/test-markdown.html | 360 ++++++++++++++++++++- 6 files changed, 360 insertions(+), 476 deletions(-) delete mode 100644 test/test-markdown-element-attributes.html delete mode 100644 test/test-markdown-external.html delete mode 100644 test/test-markdown-options.html delete mode 100644 test/test-markdown-slide-attributes.html diff --git a/gulpfile.js b/gulpfile.js index ae417a4..682ee90 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -81,6 +81,15 @@ gulp.task('css', gulp.parallel('css-themes', 'css-core')) gulp.task('test-qunit', function() { + let serverConfig = { + root, + port: 8009, + host: '0.0.0.0', + name: 'test-server' + } + + connect.server( serverConfig ) + let testFiles = glob.sync('test/*.html' ) let totalTests = 0; @@ -89,7 +98,7 @@ gulp.task('test-qunit', function() { let tests = Promise.all( testFiles.map( filename => { return new Promise( ( resolve, reject ) => { runQunitPuppeteer({ - targetUrl: `file://${path.join(__dirname, filename)}`, + targetUrl: `http://${serverConfig.host}:${serverConfig.port}/${filename}`, timeout: 20000, redirectConsole: false, puppeteerArgs: ['--allow-file-access-from-files'] @@ -129,6 +138,9 @@ gulp.task('test-qunit', function() { } ) .catch( () => { reject(); + } ) + .finally( () => { + connect.serverClose(); } ); } ); diff --git a/test/test-markdown-element-attributes.html b/test/test-markdown-element-attributes.html deleted file mode 100644 index 9afca2c..0000000 --- a/test/test-markdown-element-attributes.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - reveal.js - Test Markdown Element Attributes - - - - - - - - -
-
- - - - - - - diff --git a/test/test-markdown-external.html b/test/test-markdown-external.html deleted file mode 100644 index 3a0fd4f..0000000 --- a/test/test-markdown-external.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - reveal.js - Test Markdown - - - - - - - -
-
- - - - - - - - - diff --git a/test/test-markdown-options.html b/test/test-markdown-options.html deleted file mode 100644 index de3ce2c..0000000 --- a/test/test-markdown-options.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - reveal.js - Test Markdown Options - - - - - - - -
-
- - - - - - - - - diff --git a/test/test-markdown-slide-attributes.html b/test/test-markdown-slide-attributes.html deleted file mode 100644 index 479ffa6..0000000 --- a/test/test-markdown-slide-attributes.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - reveal.js - Test Markdown Attributes - - - - - - - -
-
- - - - - - - - - diff --git a/test/test-markdown.html b/test/test-markdown.html index 0879487..a3b5dff 100644 --- a/test/test-markdown.html +++ b/test/test-markdown.html @@ -16,13 +16,8 @@
-