mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-09 08:06:48 +02:00
refactored tests
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="../dist/reveal.css" />
|
||||
<link rel="stylesheet" href="../dist/theme/white.css" id="theme" />
|
||||
|
||||
<link rel="stylesheet" href="../plugin/highlight/monokai.css" />
|
||||
<link rel="stylesheet" href="../dist/plugin/highlight/monokai.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@@ -29,7 +29,7 @@ import {
|
||||
} from './utils/constants.js'
|
||||
|
||||
// The reveal.js version
|
||||
export const VERSION = '5.2.1';
|
||||
export const VERSION = '6.0.0';
|
||||
|
||||
/**
|
||||
* reveal.js
|
||||
|
8008
package-lock.json
generated
8008
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
44
package.json
44
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "reveal.js",
|
||||
"version": "5.0.5",
|
||||
"version": "6.0.0-rc.1",
|
||||
"description": "The HTML Presentation Framework",
|
||||
"homepage": "https://revealjs.com",
|
||||
"subdomain": "revealjs",
|
||||
@@ -83,46 +83,8 @@
|
||||
"qunit": "^2.22.0",
|
||||
"sass": "^1.80.2",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.4.9",
|
||||
"vite": "^5.4.10",
|
||||
"vite-plugin-dts": "^4.2.4"
|
||||
},
|
||||
"browserslist": "> 2%, not dead",
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"parser": "@babel/eslint-parser",
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"allowImportExportEverywhere": true,
|
||||
"requireConfigFile": false
|
||||
},
|
||||
"globals": {
|
||||
"module": false,
|
||||
"console": false,
|
||||
"unescape": false,
|
||||
"define": false,
|
||||
"exports": false
|
||||
},
|
||||
"rules": {
|
||||
"curly": 0,
|
||||
"eqeqeq": 2,
|
||||
"wrap-iife": [
|
||||
2,
|
||||
"any"
|
||||
],
|
||||
"no-use-before-define": [
|
||||
2,
|
||||
{
|
||||
"functions": false
|
||||
}
|
||||
],
|
||||
"new-cap": 2,
|
||||
"no-caller": 2,
|
||||
"dot-notation": 0,
|
||||
"no-eq-null": 2,
|
||||
"no-unused-expressions": 0
|
||||
}
|
||||
}
|
||||
"browserslist": "> 2%, not dead"
|
||||
}
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Auto-Animate</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -62,11 +58,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.config.reorder = false;
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
const slides = Array.prototype.map.call( document.querySelectorAll( '.slides section' ), slide => {
|
||||
return {
|
||||
@@ -77,9 +77,11 @@
|
||||
};
|
||||
} );
|
||||
|
||||
Reveal.initialize().then( async () => {
|
||||
QUnit.module( 'Auto-Animate' );
|
||||
|
||||
QUnit.module( 'Auto-Animate' );
|
||||
Reveal.initialize().then( () => {
|
||||
|
||||
QUnit.start();
|
||||
|
||||
QUnit.test( 'Adds data-auto-animate-target', assert => {
|
||||
Reveal.slide(1);
|
||||
@@ -111,7 +113,7 @@
|
||||
});
|
||||
|
||||
QUnit.test( 'Slide specific data-auto-animate-duration', assert => {
|
||||
assert.timeout( 400 );
|
||||
assert.timeout( 2000 );
|
||||
assert.expect( 1 );
|
||||
|
||||
return new Promise( resolve => {
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Async Dependencies</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -26,13 +22,19 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
var externalScriptSequence = '';
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
window.externalScriptSequence = '';
|
||||
|
||||
var scriptCount = 0;
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
QUnit.module( 'Async Dependencies' );
|
||||
|
||||
QUnit.test( 'Async scripts are loaded', function( assert ) {
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Dependencies</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -26,8 +22,12 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
window.externalScriptSequence = '';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Dependencies</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -29,8 +25,11 @@
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
import Reveal from '../dist/reveal.mjs'
|
||||
import Markdown from '../dist/plugin/markdown.mjs'
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
import Markdown from 'reveal.js/plugin/markdown';
|
||||
|
||||
QUnit.module( 'Destroy' );
|
||||
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Grid</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -38,8 +34,12 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.config.autostart = false;
|
||||
QUnit.module( 'Grid Navigation' );
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Iframe Backgrounds</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -31,8 +27,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Iframes</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -31,8 +27,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Markdown</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -315,9 +311,12 @@
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
import Reveal from '../js';
|
||||
import Markdown from '../plugin/markdown'
|
||||
import Highlight from '../plugin/highlight'
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
import Markdown from 'reveal.js/plugin/markdown'
|
||||
import Highlight from 'reveal.js/plugin/highlight'
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Iframes</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -36,9 +32,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script src="../dist/plugin/zoom.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
import RevealZoom from 'reveal.js/plugin/zoom';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.module( 'Multiple reveal.js instances' );
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Iframes</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -37,9 +33,11 @@
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
|
||||
import Reveal from '../js';
|
||||
import Zoom from '../plugin/zoom';
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
import Zoom from 'reveal.js/plugin/zoom';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.module( 'Multiple reveal.js instances' );
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test PDF exports</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -73,8 +69,12 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Plugins</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -26,8 +22,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.module( 'Plugins' );
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Scroll View</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -43,11 +39,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
QUnit.config.reorder = false;
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
function getScrollHeight() {
|
||||
return Reveal.getViewportElement().scrollHeight;
|
||||
@@ -57,9 +57,11 @@
|
||||
return Reveal.getViewportElement().offsetHeight;
|
||||
}
|
||||
|
||||
QUnit.module( 'Scroll View' );
|
||||
|
||||
Reveal.initialize({ view: 'scroll' }).then( async () => {
|
||||
|
||||
QUnit.module( 'Scroll View' );
|
||||
QUnit.start();
|
||||
|
||||
QUnit.test( 'Activates', assert => {
|
||||
assert.ok( getScrollHeight() > getViewportHeight(), 'Is overflowing' );
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test State</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -36,8 +32,11 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
Reveal.initialize();
|
||||
|
||||
|
@@ -5,10 +5,6 @@
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Tests</title>
|
||||
|
||||
<link rel="stylesheet" href="../dist/reveal.css">
|
||||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
|
||||
<script src="../node_modules/qunit/qunit/qunit.js"></script>
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
@@ -81,8 +77,12 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../dist/reveal.js"></script>
|
||||
<script>
|
||||
<script type="module">
|
||||
import 'reveal.css';
|
||||
import 'qunit/qunit/qunit.css';
|
||||
import QUnit from 'qunit';
|
||||
import Reveal from 'reveal.js';
|
||||
|
||||
QUnit.config.testTimeout = 30000;
|
||||
|
||||
window.location.hash = '';
|
||||
|
@@ -6,6 +6,7 @@ import fs from 'fs';
|
||||
const themeFiles = fs
|
||||
.readdirSync(resolve(__dirname, 'css/theme'))
|
||||
.filter((file) => file.endsWith('.scss'));
|
||||
|
||||
const themeEntries = themeFiles.reduce((acc, file) => {
|
||||
acc[`theme/${file.replace('.scss', '')}`] = resolve(__dirname, `css/theme/${file}`);
|
||||
return acc;
|
||||
|
@@ -31,8 +31,9 @@ export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
// Matches the exported paths in package.json
|
||||
'reveal.js/plugin': './plugin',
|
||||
'reveal.js/plugin': '/plugin',
|
||||
'reveal.js': '/js',
|
||||
'reveal.css': '/css/reveal.scss',
|
||||
},
|
||||
},
|
||||
plugins: [dts({ insertTypesEntry: true, rollupTypes: true })],
|
||||
|
Reference in New Issue
Block a user