Skip to content

Commit

Permalink
Build: Fold core.js into qunit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Aug 27, 2024
1 parent 05a52c8 commit 6799e6a
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 71 deletions.
69 changes: 0 additions & 69 deletions src/core/core.js

This file was deleted.

72 changes: 70 additions & 2 deletions src/core/qunit.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,76 @@
import QUnit from './core.js';
import { initBrowser } from './browser/browser-runner.js';
// Imports that define the QUnit API
import Assert from './assert.js';
import { createRegisterCallbackFunction } from './callbacks.js';
import config from './config.js';
import diff from './diff.js';
import dump from './dump.js';
import equiv from './equiv.js';
import { on } from './events.js';
import { window, document } from './globals.js';
import hooks from './hooks.js';
import { module, unnamedModule } from './module.js';
import onUncaughtException from './on-uncaught-exception.js';
import ProcessingQueue from './processing-queue.js';
import reporters from './reporters.js';
import { stack } from './stacktrace.js';
import { start } from './start.js';
import { urlParams } from './urlparams.js';
import { test, pushFailure } from './test.js';
import { objectType, is } from './utilities.js';
import version from './version.js';

// Imports that help with init
import { initBrowser } from './browser/browser-runner.js';
import exportQUnit from './export.js';

config.currentModule = unnamedModule;
config._pq = new ProcessingQueue();

const QUnit = {

// Figure out if we're running the tests from a server or not
isLocal: (window && window.location && window.location.protocol === 'file:'),

// Expose the current QUnit version
version,

config,
stack,
urlParams,

diff,
dump,
equiv,
reporters,
hooks,
is,
on,
objectType,
onUncaughtException,
pushFailure,

begin: createRegisterCallbackFunction('begin'),
done: createRegisterCallbackFunction('done'),
log: createRegisterCallbackFunction('log'),
moduleDone: createRegisterCallbackFunction('moduleDone'),
moduleStart: createRegisterCallbackFunction('moduleStart'),
testDone: createRegisterCallbackFunction('testDone'),
testStart: createRegisterCallbackFunction('testStart'),

assert: Assert.prototype,
module,
start,
test,

// alias other test flavors for easy access
todo: test.todo,
skip: test.skip,
only: test.only
};

// Inject the exported QUnit API for use by reporters in start()
config._QUnit = QUnit;

exportQUnit(QUnit);

if (window && document) {
Expand Down

0 comments on commit 6799e6a

Please sign in to comment.