Skip to content

Commit

Permalink
Test: Move various files to a new "browser-runner" subdir
Browse files Browse the repository at this point in the history
We've moved most files in this directory out already. The two remaining
files relate to the now-decoupled browser runner, not the HTML Reporter.

Move several other clearly browser-specific test files there as well.
  • Loading branch information
Krinkle committed Jul 15, 2024
1 parent f1b373d commit 3757f2b
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 27 deletions.
15 changes: 8 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,9 @@ module.exports = function (grunt) {
urls: [
'test/index.html',

'test/amd.html',
'test/autostart.html',
'test/config-fixture-null.html',
'test/config-fixture-string.html',
'test/dynamic-import.html',
'test/events-filters.html',
'test/events-in-test.html',
'test/headless.html',
'test/index-es5.html',
'test/index-xhtml.xhtml',
'test/logs.html',
Expand All @@ -106,8 +101,14 @@ module.exports = function (grunt) {
'test/webWorker.html',

'demos/q4000-qunit.html',
'test/reporter-html/window-onerror-preexisting-handler.html',
'test/reporter-html/window-onerror.html'

'test/browser-runner/amd.html',
'test/browser-runner/autostart.html',
'test/browser-runner/config-fixture-null.html',
'test/browser-runner/config-fixture-string.html',
'test/browser-runner/headless.html',
'test/browser-runner/window-onerror-preexisting-handler.html',
'test/browser-runner/window-onerror.html'

].map(file => `http://localhost:${connectPort}/${file}`)
}
Expand Down
6 changes: 3 additions & 3 deletions test/amd.html → test/browser-runner/amd.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta charset="UTF-8">
<title>amd</title>
<link rel="stylesheet" href="../src/qunit.css">
<script src="../qunit/qunit.js"></script>
<script src="../node_modules/requirejs/require.js"></script>
<link rel="stylesheet" href="../../src/qunit.css">
<script src="../../qunit/qunit.js"></script>
<script src="../../node_modules/requirejs/require.js"></script>
</head>
<body>
<div id="qunit"></div>
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions test/autostart.html → test/browser-runner/autostart.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="UTF-8">
<title>autostart</title>
<link rel="stylesheet" href="../src/qunit.css">
<link rel="stylesheet" href="../../src/qunit.css">
</head>
<body>
<div id="qunit"></div>
<script src="../qunit/qunit.js"></script>
<script src="../../qunit/qunit.js"></script>
<script>
window.times = {};

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="UTF-8">
<title>config-fixture-null</title>
<link rel="stylesheet" href="../src/qunit.css">
<script src="../qunit/qunit.js"></script>
<link rel="stylesheet" href="../../src/qunit.css">
<script src="../../qunit/qunit.js"></script>
<script src="config-fixture-null.js"></script>
</head>
<body>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="UTF-8">
<title>config-fixture-string</title>
<link rel="stylesheet" href="../src/qunit.css">
<script src="../qunit/qunit.js"></script>
<link rel="stylesheet" href="../../src/qunit.css">
<script src="../../qunit/qunit.js"></script>
<script src="config-fixture-string.js"></script>
</head>
<body>
Expand Down
File renamed without changes.
10 changes: 6 additions & 4 deletions test/headless.html → test/browser-runner/headless.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<head>
<meta charset="UTF-8">
<title>headless</title>
<link rel="stylesheet" href="../src/qunit.css">
<script src="../qunit/qunit.js"></script>
<script src="main/test.js"></script>
<script src="main/deepEqual.js"></script>
<link rel="stylesheet" href="../../src/qunit.css">
<script src="../../qunit/qunit.js"></script>
<script src="../main/assert.js"></script>
<script src="../main/deepEqual.js"></script>
<script src="../main/TapReporter.js"></script>
<script src="../main/test.js"></script>
<script>
(function () {
function createCallback (eventName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>QUnit HTML Reporter - window.onerror tests with preexisting handler</title>
<title>window.onerror with pre-existing handler</title>
<link rel="stylesheet" href="../../src/qunit.css">
<script>
/* exported onerrorCallingContext */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env browser */
/* global onerrorReturnValue: true, onerrorCallingContext: true */

QUnit.module('window.onerror (with preexisting handler)', function (hooks) {
QUnit.module('window.onerror [with preexisting handler]', function (hooks) {
var originalOnUncaught;

hooks.beforeEach(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>QUnit HTML Reporter - window.onerror tests with no existing handler</title>
<title>window-onerror (no pre-existing handler)</title>
<link rel="stylesheet" href="../../src/qunit.css">
<script src="../../qunit/qunit.js"></script>
<script src="./window-onerror.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env browser */
QUnit.module('window.onerror (no preexisting handler)', function (hooks) {
QUnit.module('window.onerror [no preexisting handler]', function (hooks) {
var originalOnUncaught;

hooks.beforeEach(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/cli/structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ QUnit.module('structure', () => {
});

QUnit.module('test/**.html', () => {
// Get a list of the HTML files, including in subdirectories (e.g. "test/reporter-html/").
// Get a list of the HTML files, including in subdirectories (e.g. "test/browser-runner/").
const files = glob('**/*.html', {
cwd: path.join(__dirname, '..'),
filesOnly: true
Expand Down
4 changes: 2 additions & 2 deletions test/main/browser-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ QUnit.module('browser-runner', function () {
QUnit.test('example', function (assert) {
var done = assert.async();

this.expectedFailure = 'global failure: Error: Error thrown in non-returned promise!';
this.expectedFailure = 'global failure: Error: Example from non-returned promise!';

// eslint-disable-next-line compat/compat -- Checked
Promise.resolve().then(function () {
// prevent test from exiting before unhandled rejection fires
setTimeout(done, 20);
throw new Error('Error thrown in non-returned promise!');
throw new Error('Example from non-returned promise!');
});
});
});
Expand Down

0 comments on commit 3757f2b

Please sign in to comment.