mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(tests): fix karma tests
This commit is contained in:
@ -224,8 +224,7 @@ function bundle(args) {
|
||||
|
||||
gulp.task('tests', function() {
|
||||
return gulp.src('ionic/**/test/**/*.spec.ts')
|
||||
.pipe(tsc(tscOptions, undefined, tscReporter))
|
||||
.pipe(babel(getBabelOptions('dist/tests')))
|
||||
.pipe(tsc(tscOptionsNoTypeCheck, undefined, tscReporter))
|
||||
.pipe(rename(function(file) {
|
||||
var regex = new RegExp(path.sep + 'test(' + path.sep + '|$)');
|
||||
file.dirname = file.dirname.replace(regex, path.sep);
|
||||
@ -495,7 +494,6 @@ function buildDemoBundle(opts, done) {
|
||||
var glob = require('glob');
|
||||
var webpack = require('webpack');
|
||||
var path = require('path');
|
||||
var _ = require('lodash');
|
||||
|
||||
var fp = 'dist/demos/'+opts.demo+'/index.js';
|
||||
if (opts.demo == 'api') {
|
||||
|
@ -7,19 +7,24 @@ module.exports = function(config) {
|
||||
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
files: buildConfig.scripts.concat([
|
||||
'node_modules/angular2/bundles/test_lib.js',
|
||||
'dist/tests/**/*.spec.js',
|
||||
files: [
|
||||
'node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader.js',
|
||||
'node_modules/systemjs/dist/system.js',
|
||||
'node_modules/angular2/bundles/angular2-polyfills.min.js',
|
||||
'node_modules/angular2/bundles/angular2.min.js',
|
||||
'node_modules/angular2/bundles/router.min.js',
|
||||
'node_modules/angular2/bundles/http.min.js',
|
||||
'node_modules/rxjs/bundles/Rx.min.js',
|
||||
'dist/bundles/ionic.system.js',
|
||||
//'node_modules/angular2/bundles/test_lib.js',
|
||||
{ pattern: 'dist/tests/**/*.spec.js', included: false },
|
||||
'scripts/karma/test-main.js'
|
||||
]),
|
||||
],
|
||||
|
||||
exclude: buildConfig.src.e2e,
|
||||
exclude: ['ionic/components/*/test/*/**/*'],
|
||||
|
||||
logLevel: 'warn',
|
||||
|
||||
preprocessors: {
|
||||
},
|
||||
|
||||
browsers: ['Chrome'],
|
||||
port: 9876
|
||||
});
|
||||
|
@ -4,7 +4,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 50;
|
||||
// we will call `__karma__.start()` later, once all the specs are loaded.
|
||||
__karma__.loaded = function() {};
|
||||
|
||||
System.import('angular2/src/core/dom/browser_adapter').then(function(browser_adapter) {
|
||||
System.import('angular2/src/platform/browser/browser_adapter').then(function(browser_adapter) {
|
||||
browser_adapter.BrowserDomAdapter.makeCurrent();
|
||||
}).then(function() {
|
||||
return Promise.all(
|
||||
@ -33,12 +33,4 @@ function onlySpecFiles(path) {
|
||||
}
|
||||
function file2moduleName(filePath) {
|
||||
return filePath.replace(/\\/g, '/')
|
||||
.replace(/^.*?base\//, '')
|
||||
// module name should be relative to `modules` and `tools` folder
|
||||
// .replace(/.*\/modules\//, '')
|
||||
// .replace(/.*\/tools\//, '')
|
||||
// module name should not include `lib`, `web` folders
|
||||
// module name should not have a suffix
|
||||
// .split('.').pop().join('');
|
||||
.replace(/\.js$/, '');
|
||||
}
|
||||
|
Reference in New Issue
Block a user