-
Notifications
You must be signed in to change notification settings - Fork 775
Expand file tree
/
Copy pathcore.js
More file actions
73 lines (62 loc) · 2.16 KB
/
core.js
File metadata and controls
73 lines (62 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { window } from './globals.js';
import equiv from './equiv.js';
import dump from './dump.js';
import { runSuite, module } from './module.js';
import Assert from './assert.js';
import { test, pushFailure } from './test.js';
import reporters from './reporters.js';
import config from './config.js';
import hooks from './hooks.js';
import { objectType, is } from './utilities.js';
import { createRegisterCallbackFunction } from './callbacks.js';
import { stack } from './stacktrace.js';
import ProcessingQueue from './processing-queue.js';
import { urlParams } from './urlparams.js';
import { on } from './events.js';
import onUncaughtException from './on-uncaught-exception.js';
import { diffHtml } from './diff.js';
import version from './version.js';
import { createStartFunction } from './start.js';
// The "currentModule" object would ideally be defined using the createModule()
// function. Since it isn't, add the missing suiteReport property to it now that
// we have loaded all source code required to do so.
//
// TODO: Consider defining currentModule in core.js or module.js in its entirely
// rather than partly in config.js and partly here.
config.currentModule.suiteReport = runSuite;
config._pq = new ProcessingQueue(test);
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: diffHtml,
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,
test,
// alias other test flavors for easy access
todo: test.todo,
skip: test.skip,
only: test.only
};
QUnit.start = createStartFunction(QUnit);
export default QUnit;