mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
use angular2/test_lib for tests
This commit is contained in:
@@ -8,6 +8,7 @@ module.exports = function(config) {
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
files: buildConfig.scripts.concat([
|
||||
'node_modules/angular2/bundles/test_lib.dev.js',
|
||||
'dist/tests/**/*.spec.js',
|
||||
'scripts/karma/test-main.js'
|
||||
]),
|
||||
|
||||
@@ -4,19 +4,23 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 50;
|
||||
// we will call `__karma__.start()` later, once all the specs are loaded.
|
||||
__karma__.loaded = function() {};
|
||||
|
||||
Promise.all(
|
||||
Object.keys(window.__karma__.files) // All files served by Karma.
|
||||
.filter(onlySpecFiles)
|
||||
.map(window.file2moduleName) // Normalize paths to module names.
|
||||
.map(function(path) {
|
||||
return System.import(path).then(function(module) {
|
||||
if (module.hasOwnProperty('run')) {
|
||||
module.run();
|
||||
} else {
|
||||
console.warn('WARNING: Module ' + path + ' does not implement a run() method. No tests run.');
|
||||
}
|
||||
});
|
||||
}))
|
||||
System.import('angular2/src/core/dom/browser_adapter').then(function(browser_adapter) {
|
||||
browser_adapter.BrowserDomAdapter.makeCurrent();
|
||||
}).then(function() {
|
||||
return Promise.all(
|
||||
Object.keys(window.__karma__.files) // All files served by Karma.
|
||||
.filter(onlySpecFiles)
|
||||
.map(window.file2moduleName) // Normalize paths to module names.
|
||||
.map(function(path) {
|
||||
return System.import(path).then(function(module) {
|
||||
if (module.hasOwnProperty('run')) {
|
||||
module.run();
|
||||
} else {
|
||||
console.warn('WARNING: Module ' + path + ' does not implement a run() method. No tests run.');
|
||||
}
|
||||
});
|
||||
}))
|
||||
})
|
||||
.then(function() {
|
||||
__karma__.start();
|
||||
}, function(error) {
|
||||
|
||||
Reference in New Issue
Block a user