diff --git a/Gruntfile.js b/Gruntfile.js index 0211cff3d..a67673102 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -31,7 +31,7 @@ module.exports = function (grunt) { options: { process: preprocess }, 'src-css': { - src: 'src/qunit.css', + src: 'src/core/qunit.css', dest: 'qunit/qunit.css' } }, diff --git a/build/watch.js b/build/dev.js similarity index 98% rename from build/watch.js rename to build/dev.js index 7e36993ff..b5c4ef40c 100644 --- a/build/watch.js +++ b/build/dev.js @@ -88,7 +88,7 @@ async function startRollupWatch () { async function startCssWatch () { const baseDir = process.cwd(); - const cssInputFile = path.resolve(baseDir, 'src/qunit.css'); + const cssInputFile = path.resolve(baseDir, 'src/core/qunit.css'); const cssOutputFile = path.resolve(baseDir, 'qunit/qunit.css'); function copyCss () { diff --git a/demos/q4000-qunit.html b/demos/q4000-qunit.html index ea5ab2b49..61b1fafb6 100644 --- a/demos/q4000-qunit.html +++ b/demos/q4000-qunit.html @@ -3,7 +3,7 @@ q4000 on QUnit - +
diff --git a/package.json b/package.json index 265967742..f9e293bc6 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "scripts": { "build": "rollup -c && grunt copy:src-css", "build-coverage": "rollup -c --environment BUILD_TARGET:coverage && grunt copy:src-css", - "build-dev": "node build/watch.js", + "build-dev": "node build/dev.js", "benchmark": "npm install --silent --no-audit --prefix test/benchmark/ && node test/benchmark/micro.js", "lint": "eslint --cache .", "lint-fix": "eslint --cache --fix .", diff --git a/rollup.config.js b/rollup.config.js index 2069e2558..3ae0b3a20 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -9,7 +9,7 @@ const { replacements } = require('./build/dist-replace.js'); const isCoverage = process.env.BUILD_TARGET === 'coverage'; module.exports = { - input: 'src/qunit.js', + input: 'src/core/qunit.js', output: { file: 'qunit/qunit.js', sourcemap: isCoverage, diff --git a/src/assert.js b/src/core/assert.js similarity index 98% rename from src/assert.js rename to src/core/assert.js index 2e3a1782c..06892dc89 100644 --- a/src/assert.js +++ b/src/core/assert.js @@ -1,8 +1,8 @@ import dump from './dump.js'; import equiv from './equiv.js'; -import config from './core/config.js'; -import { objectType, objectValues, objectValuesSubset, errorString } from './core/utilities.js'; -import { sourceFromStacktrace } from './core/stacktrace.js'; +import config from './config.js'; +import { objectType, objectValues, objectValuesSubset, errorString } from './utilities.js'; +import { sourceFromStacktrace } from './stacktrace.js'; import { clearTimeout } from './globals.js'; class Assert { diff --git a/src/browser/browser-runner.js b/src/core/browser/browser-runner.js similarity index 100% rename from src/browser/browser-runner.js rename to src/core/browser/browser-runner.js diff --git a/src/browser/fixture.js b/src/core/browser/fixture.js similarity index 100% rename from src/browser/fixture.js rename to src/core/browser/fixture.js diff --git a/src/browser/urlparams.js b/src/core/browser/urlparams.js similarity index 100% rename from src/browser/urlparams.js rename to src/core/browser/urlparams.js diff --git a/src/callbacks.js b/src/core/callbacks.js similarity index 96% rename from src/callbacks.js rename to src/core/callbacks.js index 880b28d49..855280ec2 100644 --- a/src/callbacks.js +++ b/src/core/callbacks.js @@ -1,4 +1,4 @@ -import config from './core/config.js'; +import config from './config.js'; import Promise from './promise.js'; export function createRegisterCallbackFunction (key) { diff --git a/src/core/config.js b/src/core/config.js index 79f2ffc08..b05358957 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -1,5 +1,5 @@ -import { globalThis, process, sessionStorage } from '../globals.js'; -import { urlParams } from '../urlparams.js'; +import { globalThis, process, sessionStorage } from './globals.js'; +import { urlParams } from './urlparams.js'; import { extend } from './utilities.js'; /** diff --git a/src/core.js b/src/core/core.js similarity index 92% rename from src/core.js rename to src/core/core.js index 37efa9d93..49b197a06 100644 --- a/src/core.js +++ b/src/core/core.js @@ -7,16 +7,16 @@ import Assert from './assert.js'; import Test, { test, pushFailure } from './test.js'; import reporters from './reporters.js'; -import config from './core/config.js'; -import hooks from './core/hooks.js'; -import { objectType, is, performance } from './core/utilities.js'; +import config from './config.js'; +import hooks from './hooks.js'; +import { objectType, is, performance } from './utilities.js'; import { createRegisterCallbackFunction, runLoggingCallbacks } from './callbacks.js'; -import { sourceFromStacktrace } from './core/stacktrace.js'; -import ProcessingQueue from './core/processing-queue.js'; +import { sourceFromStacktrace } from './stacktrace.js'; +import ProcessingQueue from './processing-queue.js'; import { urlParams } from './urlparams.js'; import { on, emit } from './events.js'; -import onUncaughtException from './core/on-uncaught-exception.js'; +import onUncaughtException from './on-uncaught-exception.js'; import diff from './diff.js'; import version from './version.js'; diff --git a/src/diff.js b/src/core/diff.js similarity index 99% rename from src/diff.js rename to src/core/diff.js index 23b0047a6..a9e3bee04 100644 --- a/src/diff.js +++ b/src/core/diff.js @@ -1,5 +1,5 @@ /* eslint-disable indent */ -import { escapeText } from './core/utilities.js'; +import { escapeText } from './utilities.js'; /* * This file is a modified version of google-diff-match-patch's JavaScript implementation diff --git a/src/dump.js b/src/core/dump.js similarity index 98% rename from src/dump.js rename to src/core/dump.js index 7cf6a03ea..76503ba32 100644 --- a/src/dump.js +++ b/src/core/dump.js @@ -28,8 +28,8 @@ // POSSIBILITY OF SUCH DAMAGE. // ------- -import config from './core/config.js'; -import { inArray, is } from './core/utilities.js'; +import config from './config.js'; +import { inArray, is } from './utilities.js'; export default (function () { function quote (str) { diff --git a/src/equiv.js b/src/core/equiv.js similarity index 99% rename from src/equiv.js rename to src/core/equiv.js index 8e512e1c8..5e7d1d9cc 100644 --- a/src/equiv.js +++ b/src/core/equiv.js @@ -1,4 +1,4 @@ -import { objectType } from './core/utilities.js'; +import { objectType } from './utilities.js'; import { StringSet } from './globals.js'; const BOXABLE_TYPES = new StringSet(['boolean', 'number', 'string']); diff --git a/src/events.js b/src/core/events.js similarity index 96% rename from src/events.js rename to src/core/events.js index 81d6a2174..cb6c0a647 100644 --- a/src/events.js +++ b/src/core/events.js @@ -1,5 +1,5 @@ -import { inArray } from './core/utilities.js'; -import config from './core/config.js'; +import { inArray } from './utilities.js'; +import config from './config.js'; const SUPPORTED_EVENTS = [ 'error', diff --git a/src/export.js b/src/core/export.js similarity index 100% rename from src/export.js rename to src/core/export.js diff --git a/src/globals.js b/src/core/globals.js similarity index 100% rename from src/globals.js rename to src/core/globals.js diff --git a/src/logger.js b/src/core/logger.js similarity index 100% rename from src/logger.js rename to src/core/logger.js diff --git a/src/module.js b/src/core/module.js similarity index 98% rename from src/module.js rename to src/core/module.js index e0fc1a22c..0b34dcbde 100644 --- a/src/module.js +++ b/src/core/module.js @@ -1,6 +1,6 @@ -import config from './core/config.js'; +import config from './config.js'; import SuiteReport from './reports/suite.js'; -import { extend, generateHash, isAsyncFunction } from './core/utilities.js'; +import { extend, generateHash, isAsyncFunction } from './utilities.js'; const moduleStack = []; diff --git a/src/core/on-uncaught-exception.js b/src/core/on-uncaught-exception.js index 47d36d8f9..cf6f89cd4 100644 --- a/src/core/on-uncaught-exception.js +++ b/src/core/on-uncaught-exception.js @@ -1,8 +1,8 @@ import config from './config.js'; -import { runSuite } from '../module.js'; +import { runSuite } from './module.js'; import { sourceFromStacktrace } from './stacktrace.js'; import { errorString } from './utilities.js'; -import { emit } from '../events.js'; +import { emit } from './events.js'; /** * Handle a global error that should result in a failed test run. diff --git a/src/core/processing-queue.js b/src/core/processing-queue.js index 397dbf5d3..29fb7ddb5 100644 --- a/src/core/processing-queue.js +++ b/src/core/processing-queue.js @@ -1,11 +1,10 @@ import config from './config.js'; import { extend, generateHash, performance } from './utilities.js'; -import { runLoggingCallbacks } from '../callbacks.js'; - -import Promise from '../promise.js'; -import { runSuite } from '../module.js'; -import { emit } from '../events.js'; -import { setTimeout } from '../globals.js'; +import { runLoggingCallbacks } from './callbacks.js'; +import Promise from './promise.js'; +import { runSuite } from './module.js'; +import { emit } from './events.js'; +import { setTimeout } from './globals.js'; /** * Creates a seeded "sample" generator which is used for randomizing tests. diff --git a/src/core/promise.js b/src/core/promise.js new file mode 100644 index 000000000..41f69c952 --- /dev/null +++ b/src/core/promise.js @@ -0,0 +1,3 @@ +import _Promise from '../../lib/promise-polyfill.js'; + +export default _Promise; diff --git a/src/qunit.css b/src/core/qunit.css similarity index 100% rename from src/qunit.css rename to src/core/qunit.css diff --git a/src/qunit.js b/src/core/qunit.js similarity index 100% rename from src/qunit.js rename to src/core/qunit.js diff --git a/src/reporters.js b/src/core/reporters.js similarity index 100% rename from src/reporters.js rename to src/core/reporters.js diff --git a/src/reporters/ConsoleReporter.js b/src/core/reporters/ConsoleReporter.js similarity index 100% rename from src/reporters/ConsoleReporter.js rename to src/core/reporters/ConsoleReporter.js diff --git a/src/reporters/HtmlReporter.js b/src/core/reporters/HtmlReporter.js similarity index 99% rename from src/reporters/HtmlReporter.js rename to src/core/reporters/HtmlReporter.js index e81c74781..a06b89ca2 100644 --- a/src/reporters/HtmlReporter.js +++ b/src/core/reporters/HtmlReporter.js @@ -1,4 +1,4 @@ -import { extend, errorString, escapeText } from '../core/utilities.js'; +import { extend, errorString, escapeText } from '../utilities.js'; import diff from '../diff.js'; import dump from '../dump.js'; import { window, document, navigator, StringMap } from '../globals.js'; diff --git a/src/reporters/PerfReporter.js b/src/core/reporters/PerfReporter.js similarity index 100% rename from src/reporters/PerfReporter.js rename to src/core/reporters/PerfReporter.js diff --git a/src/reporters/TapReporter.js b/src/core/reporters/TapReporter.js similarity index 99% rename from src/reporters/TapReporter.js rename to src/core/reporters/TapReporter.js index c52ffff78..326d784ff 100644 --- a/src/reporters/TapReporter.js +++ b/src/core/reporters/TapReporter.js @@ -1,6 +1,7 @@ import kleur from 'kleur'; -import { errorString } from '../core/utilities.js'; +import { errorString } from '../utilities.js'; import { console } from '../globals.js'; + const hasOwn = Object.prototype.hasOwnProperty; /** diff --git a/src/reports/suite.js b/src/core/reports/suite.js similarity index 98% rename from src/reports/suite.js rename to src/core/reports/suite.js index 393ebc364..ae461d3b1 100644 --- a/src/reports/suite.js +++ b/src/core/reports/suite.js @@ -1,4 +1,4 @@ -import { performance } from '../core/utilities.js'; +import { performance } from '../utilities.js'; export default class SuiteReport { constructor (name, parentSuite) { diff --git a/src/reports/test.js b/src/core/reports/test.js similarity index 96% rename from src/reports/test.js rename to src/core/reports/test.js index 865c9614b..959dabb57 100644 --- a/src/reports/test.js +++ b/src/core/reports/test.js @@ -1,4 +1,4 @@ -import { extend, performance } from '../core/utilities.js'; +import { extend, performance } from '../utilities.js'; export default class TestReport { constructor (name, suite, options) { diff --git a/src/test.js b/src/core/test.js similarity index 99% rename from src/test.js rename to src/core/test.js index 25b250585..1069e713e 100644 --- a/src/test.js +++ b/src/core/test.js @@ -3,8 +3,7 @@ import { emit } from './events.js'; import Assert from './assert.js'; import Logger from './logger.js'; import Promise from './promise.js'; - -import config from './core/config.js'; +import config from './config.js'; import { diff, errorString, @@ -13,11 +12,10 @@ import { hasOwn, inArray, performance -} from './core/utilities.js'; +} from './utilities.js'; import { runLoggingCallbacks } from './callbacks.js'; -import { extractStacktrace, sourceFromStacktrace } from './core/stacktrace.js'; +import { extractStacktrace, sourceFromStacktrace } from './stacktrace.js'; import dump from './dump.js'; - import TestReport from './reports/test.js'; export default function Test (settings) { diff --git a/src/urlparams.js b/src/core/urlparams.js similarity index 100% rename from src/urlparams.js rename to src/core/urlparams.js diff --git a/src/core/utilities.js b/src/core/utilities.js index 12da5bc8c..1ee5f1ed7 100644 --- a/src/core/utilities.js +++ b/src/core/utilities.js @@ -1,4 +1,4 @@ -import { window } from '../globals.js'; +import { window } from './globals.js'; export const toString = Object.prototype.toString; export const hasOwn = Object.prototype.hasOwnProperty; diff --git a/src/version.js b/src/core/version.js similarity index 100% rename from src/version.js rename to src/core/version.js diff --git a/src/promise.js b/src/promise.js deleted file mode 100644 index e5871b295..000000000 --- a/src/promise.js +++ /dev/null @@ -1,3 +0,0 @@ -import _Promise from '../lib/promise-polyfill.js'; - -export default _Promise; diff --git a/test/browser-runner/amd.html b/test/browser-runner/amd.html index 8f098498e..c2937a562 100644 --- a/test/browser-runner/amd.html +++ b/test/browser-runner/amd.html @@ -3,7 +3,7 @@ amd - + diff --git a/test/browser-runner/autostart.html b/test/browser-runner/autostart.html index bb09d236f..4f24ae339 100644 --- a/test/browser-runner/autostart.html +++ b/test/browser-runner/autostart.html @@ -3,7 +3,7 @@ autostart - +
diff --git a/test/browser-runner/config-fixture-null.html b/test/browser-runner/config-fixture-null.html index c30238ebd..17210dab1 100644 --- a/test/browser-runner/config-fixture-null.html +++ b/test/browser-runner/config-fixture-null.html @@ -3,7 +3,7 @@ config-fixture-null - + diff --git a/test/browser-runner/config-fixture-string.html b/test/browser-runner/config-fixture-string.html index 8e0328888..1daa70604 100644 --- a/test/browser-runner/config-fixture-string.html +++ b/test/browser-runner/config-fixture-string.html @@ -3,7 +3,7 @@ config-fixture-string - + diff --git a/test/browser-runner/headless.html b/test/browser-runner/headless.html index 90740e98e..462a6e641 100644 --- a/test/browser-runner/headless.html +++ b/test/browser-runner/headless.html @@ -3,7 +3,7 @@ headless - + diff --git a/test/browser-runner/window-onerror-preexisting-handler.html b/test/browser-runner/window-onerror-preexisting-handler.html index ee38c0553..c74e9fce6 100644 --- a/test/browser-runner/window-onerror-preexisting-handler.html +++ b/test/browser-runner/window-onerror-preexisting-handler.html @@ -3,7 +3,7 @@ window.onerror with pre-existing handler - + diff --git a/test/dynamic-import.html b/test/dynamic-import.html index 3b8f3510c..a84faaf7e 100644 --- a/test/dynamic-import.html +++ b/test/dynamic-import.html @@ -3,7 +3,7 @@ QUnit - +
diff --git a/test/events-filters.html b/test/events-filters.html index ad112da98..526a1da4e 100644 --- a/test/events-filters.html +++ b/test/events-filters.html @@ -3,7 +3,7 @@ events-filters - + diff --git a/test/events-in-test.html b/test/events-in-test.html index 73f57698a..f94e852f4 100644 --- a/test/events-in-test.html +++ b/test/events-in-test.html @@ -3,7 +3,7 @@ events-in-test - + diff --git a/test/index-es5.html b/test/index-es5.html index 0e8395d6b..12aaa9ecc 100644 --- a/test/index-es5.html +++ b/test/index-es5.html @@ -3,7 +3,7 @@ index-es5 - + diff --git a/test/module-skip.html b/test/module-skip.html index df8a93858..9d701dd38 100644 --- a/test/module-skip.html +++ b/test/module-skip.html @@ -3,7 +3,7 @@ module-skip - + diff --git a/test/module-todo.html b/test/module-todo.html index 07000caa2..4c7b864b1 100644 --- a/test/module-todo.html +++ b/test/module-todo.html @@ -3,7 +3,7 @@ module-todo - + diff --git a/test/only-each.html b/test/only-each.html index c1e102178..ebcfb03f7 100644 --- a/test/only-each.html +++ b/test/only-each.html @@ -3,7 +3,7 @@ only-each - + diff --git a/test/overload.html b/test/overload.html index 961cef518..c6c59f670 100644 --- a/test/overload.html +++ b/test/overload.html @@ -3,7 +3,7 @@ overload - + diff --git a/test/preconfig-flat-testId.html b/test/preconfig-flat-testId.html index 0cbcbb231..551b19d93 100644 --- a/test/preconfig-flat-testId.html +++ b/test/preconfig-flat-testId.html @@ -3,7 +3,7 @@ preconfig-flat-testId - + diff --git a/test/reorderError1.html b/test/reorderError1.html index ff98faab0..d46598141 100644 --- a/test/reorderError1.html +++ b/test/reorderError1.html @@ -3,7 +3,7 @@ reorderError1 - + diff --git a/test/sandboxed-iframe--contents.html b/test/sandboxed-iframe--contents.html index 6ed2022b4..94657c41f 100644 --- a/test/sandboxed-iframe--contents.html +++ b/test/sandboxed-iframe--contents.html @@ -3,7 +3,7 @@ sandboxed-iframe-contents - + diff --git a/test/sandboxed-iframe.html b/test/sandboxed-iframe.html index 4b1658b44..bc2f458fa 100644 --- a/test/sandboxed-iframe.html +++ b/test/sandboxed-iframe.html @@ -3,7 +3,7 @@ sandboxed-iframe - + diff --git a/test/seed.html b/test/seed.html index c79352b27..114484485 100644 --- a/test/seed.html +++ b/test/seed.html @@ -3,7 +3,7 @@ seed - + diff --git a/test/startError.html b/test/startError.html index 5c3c700dd..607767cb4 100644 --- a/test/startError.html +++ b/test/startError.html @@ -3,7 +3,7 @@ startError - +
diff --git a/test/urlparams-filter.html b/test/urlparams-filter.html index 61ddc7cac..ee30ec376 100644 --- a/test/urlparams-filter.html +++ b/test/urlparams-filter.html @@ -3,7 +3,7 @@ QUnit - +
diff --git a/test/urlparams-module.html b/test/urlparams-module.html index d36480119..7f9279a29 100644 --- a/test/urlparams-module.html +++ b/test/urlparams-module.html @@ -3,7 +3,7 @@ QUnit - +
diff --git a/test/urlparams-moduleId.html b/test/urlparams-moduleId.html index a5c62966b..27f71cbf6 100644 --- a/test/urlparams-moduleId.html +++ b/test/urlparams-moduleId.html @@ -3,7 +3,7 @@ QUnit - +
diff --git a/test/urlparams-testId.html b/test/urlparams-testId.html index db1315c8e..063fce90b 100644 --- a/test/urlparams-testId.html +++ b/test/urlparams-testId.html @@ -3,7 +3,7 @@ QUnit - +
diff --git a/test/webWorker.html b/test/webWorker.html index 0e732a7c0..c618d4fc5 100644 --- a/test/webWorker.html +++ b/test/webWorker.html @@ -3,7 +3,7 @@ webWorker - +