-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathtemplate-compiler-test.js
More file actions
69 lines (60 loc) · 2.15 KB
/
template-compiler-test.js
File metadata and controls
69 lines (60 loc) · 2.15 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
const path = require('path');
const emberSourceRoot = path.dirname(require.resolve('ember-source/package.json'));
const distPath = path.join(emberSourceRoot, 'dist');
let templateCompiler;
QUnit.module('ember-template-compiler.js', function () {
QUnit.module('modern', function (hooks) {
hooks.beforeEach(function () {
this.templateCompilerPath = path.resolve(path.join(distPath, 'ember-template-compiler.js'));
templateCompiler = require(this.templateCompilerPath);
});
hooks.afterEach(function () {
// clear the previously cached version of this module
delete require.cache[this.templateCompilerPath];
});
QUnit.test('can be required', function (assert) {
assert.strictEqual(
typeof templateCompiler.precompile,
'function',
'precompile function is present'
);
assert.strictEqual(
typeof templateCompiler.compile,
'function',
'compile function is present'
);
});
QUnit.test('can access _Ember.ENV (private API used by ember-cli-htmlbars)', function (assert) {
assert.equal(typeof templateCompiler._Ember.ENV, 'object', '_Ember.ENV is present');
assert.notEqual(typeof templateCompiler._Ember.ENV, null, '_Ember.ENV is not null');
});
QUnit.test('_Ember.ENV (private API used by ember-cli-htmlbars) is stable', function (assert) {
assert.strictEqual(
templateCompiler._Ember.ENV,
templateCompiler._Ember.ENV,
'_Ember.ENV is stable'
);
});
QUnit.test(
'can access _Ember.FEATURES (private API used by ember-cli-htmlbars)',
function (assert) {
assert.equal(
typeof templateCompiler._Ember.FEATURES,
'object',
'_Ember.FEATURES is present'
);
assert.notEqual(
typeof templateCompiler._Ember.FEATURES,
null,
'_Ember.FEATURES is not null'
);
}
);
QUnit.test(
'can access _Ember.VERSION (private API used by ember-cli-htmlbars)',
function (assert) {
assert.equal(typeof templateCompiler._Ember.VERSION, 'string', '_Ember.VERSION is present');
}
);
});
});