-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdebug-utils-test.js
More file actions
33 lines (27 loc) · 987 Bytes
/
debug-utils-test.js
File metadata and controls
33 lines (27 loc) · 987 Bytes
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
import { test, module } from 'qunit';
import { assert } from '@ember/debug';
import { DEBUG } from '@glimmer/env';
import { isDevelopingApp, isTesting } from '@embroider/macros';
module('debug utils remain in the build', function () {
test('assert', function(qAssert) {
// If we get the build mode wrong, e.g.: `NODE_ENV` != 'development'
// then the assert won't exist, causing qAssert to not detect a thrown Error
qAssert.throws(() => {
assert('should throw');
}, /should throw/, `The error "should throw" is thrown`);
});
test('isTesting', function (assert) {
assert.strictEqual(isTesting(), true, `isTesting() === true`);
});
test('isDevelopingApp', function (assert) {
assert.strictEqual(isDevelopingApp(), true, `isDevelopingApp() === true`);
});
module('not supported', function () {
test('DEBUG', function (assert) {
if (DEBUG) {
assert.step('DEBUG');
}
assert.verifySteps([]);
});
});
});