mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-18 14:53:14 +00:00
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
suite('AMD tests', function () {
|
|
|
|
test('Loading an AMD module', function () {
|
|
return System.import('fixtures/amd-module.js').then(function (m) {
|
|
assert.ok(m.default);
|
|
assert.equal(m.default.amd, true);
|
|
assert.equal(m.default.dep.amd, 'dep');
|
|
});
|
|
});
|
|
|
|
test('Loading AMD exports dependency', function () {
|
|
return System.import('fixtures/amd-exports.js').then(function (m) {
|
|
assert.ok(m.default);
|
|
assert.equal(m.default.test, 'hi');
|
|
assert.equal(m.default.dep.amd, 'dep');
|
|
});
|
|
});
|
|
|
|
test('AMD Circular', function () {
|
|
return System.import('fixtures/amd-circular1.js').then(function (m) {
|
|
assert.ok(m.default);
|
|
assert.equal(m.default.outFunc(), 5);
|
|
});
|
|
});
|
|
|
|
test('Loading an AMD named define', function () {
|
|
return System.import('fixtures/nameddefine.js').then(function (m1) {
|
|
assert.ok(m1.default);
|
|
assert.equal(m1.default.another, 'define');
|
|
});
|
|
});
|
|
|
|
test('Loading an AMD bundle with multiple anonymous defines', function () {
|
|
return System.import('fixtures/multiple-anonymous.js').then(function (m) {
|
|
assert.ok(m.default);
|
|
assert.equal(m.default.anon, true);
|
|
});
|
|
});
|
|
|
|
test('AMD falls back to global support', function () {
|
|
return System.import('fixtures/global2.js').then(function (m) {
|
|
assert.equal(m.default, 'hi');
|
|
});
|
|
});
|
|
|
|
}); |