mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
make tests es6 modules
This commit is contained in:
@@ -3,7 +3,7 @@ module.exports = {
|
||||
distLib: 'dist/lib',
|
||||
src: {
|
||||
spec: ['ionic/**/test/*.spec.js'],
|
||||
js: ['ionic/**/*.js', '!src/**/test/**/*.js'],
|
||||
js: ['ionic/**/*.js'],
|
||||
|
||||
// Get all the non-js files and main.js
|
||||
e2e: ['ionic/components/*/test/*/**/*'],
|
||||
@@ -12,40 +12,15 @@ module.exports = {
|
||||
},
|
||||
|
||||
scripts: [
|
||||
{
|
||||
from: 'node_modules/gulp-traceur/node_modules/traceur/bin/traceur.js',
|
||||
to: 'traceur.js',
|
||||
}, {
|
||||
from: 'node_modules/es6-module-loader/dist/es6-module-loader.src.js',
|
||||
to: 'es6-module-loader.src.js'
|
||||
}, {
|
||||
from: 'node_modules/systemjs/dist/system.src.js',
|
||||
to: 'system.src.js'
|
||||
}, {
|
||||
from: 'scripts/e2e/system-init.js',
|
||||
to: 'system-init.js'
|
||||
}, {
|
||||
from: 'node_modules/angular2/node_modules/zone.js/zone.js',
|
||||
to: 'zone.js'
|
||||
}, {
|
||||
from: 'node_modules/angular2/node_modules/zone.js/long-stack-trace-zone.js',
|
||||
to: 'long-stack-trace-zone.js'
|
||||
},
|
||||
'angular2.js',
|
||||
'angular2-di.js',
|
||||
'ionic2.js',
|
||||
// 'https://cdn.firebase.com/js/client/2.2.4/firebase.js'
|
||||
// 'https://cdn.firebase.com/js/client/2.2.4/firebase-debug.js'
|
||||
'scripts/resources/traceur-runtime.js',
|
||||
{ pattern: 'jspm_packages/es6-module-loader.js', included: false },
|
||||
'jspm_packages/system.src.js',
|
||||
'config.js',
|
||||
'scripts/resources/angular2.dev.js',
|
||||
'dist/js/ionic.bundle.js',
|
||||
'dist/vendor/web-animations-js/web-animations.min.js'
|
||||
],
|
||||
|
||||
traceurOptions: {
|
||||
sourceMaps: true,
|
||||
annotations: true,
|
||||
types: true,
|
||||
memberVariables: true,
|
||||
modules: 'instantiate',
|
||||
},
|
||||
|
||||
protractorPort: 8876,
|
||||
|
||||
autoprefixer: {
|
||||
|
||||
@@ -2,14 +2,15 @@ var buildConfig = require('../build/config');
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
singleRun: true,
|
||||
basePath: '../..',
|
||||
//singleRun: true,
|
||||
basePath: '../../',
|
||||
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
files: buildConfig.scripts.concat([
|
||||
{pattern: 'ionic2/**/*.js', included: false},
|
||||
'../../scripts/test/test-main.js',
|
||||
'dist/js/es5/ionic/**/*.js',
|
||||
'dist/tests/**/*.spec.js',
|
||||
'scripts/test/test-main.js'
|
||||
]),
|
||||
|
||||
exclude: buildConfig.src.e2e,
|
||||
@@ -17,7 +18,6 @@ module.exports = function(config) {
|
||||
logLevel: 'warn',
|
||||
|
||||
preprocessors: {
|
||||
'modules/**/*.js': ['traceur']
|
||||
},
|
||||
|
||||
browsers: ['Chrome'],
|
||||
|
||||
@@ -4,26 +4,12 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 50;
|
||||
// we will call `__karma__.start()` later, once all the specs are loaded.
|
||||
__karma__.loaded = function() {};
|
||||
|
||||
System.config({
|
||||
baseURL: 'http://localhost:9876/base',
|
||||
traceurOptions: {
|
||||
'sourceMaps': true,
|
||||
'annotations': true,
|
||||
'types': true,
|
||||
'script': false,
|
||||
'memberVariables': true,
|
||||
'modules': 'instantiate'
|
||||
},
|
||||
map: {
|
||||
'rx/dist/rx.all': 'rx.all',
|
||||
}
|
||||
})
|
||||
|
||||
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) {
|
||||
debugger;
|
||||
return System.import(path).then(function(module) {
|
||||
if (module.hasOwnProperty('run')) {
|
||||
module.run();
|
||||
|
||||
Reference in New Issue
Block a user