cleanup(testing): create top level files for mocks

Closes #5381
This commit is contained in:
vsavkin 2015-11-24 09:57:24 -08:00 committed by Victor Savkin
parent 89eefcd7b5
commit 8daa9b202d
13 changed files with 21 additions and 11 deletions

View File

@ -991,7 +991,7 @@ gulp.task("!bundle.web_worker.js.dev", ["build.js.dev"], function() {
gulp.task('!bundle.testing', ['build.js.dev'], function() {
var devBundleConfig = merge(true, bundleConfig);
devBundleConfig.paths = merge(true, devBundleConfig.paths, {"*": "dist/js/dev/es5/*.js"});
return bundler.bundle(devBundleConfig, 'angular2/testing + angular2/mock - angular2/angular2',
return bundler.bundle(devBundleConfig, 'angular2/testing - angular2/angular2',
'./dist/js/bundle/testing.js', {sourceMaps: true});
});

View File

@ -8,7 +8,7 @@ library angular2;
export 'package:angular2/core.dart'
hide forwardRef, resolveForwardRef, ForwardRefFn;
export 'package:angular2/common.dart';
export 'package:angular2/profile.dart';
export 'package:angular2/instrumentation.dart';
export 'package:angular2/src/core/application_tokens.dart'
hide APP_COMPONENT_REF_PROMISE, APP_ID_RANDOM_PROVIDER;
export 'package:angular2/src/platform/dom/dom_tokens.dart';

View File

@ -0,0 +1 @@
export * from 'angular2/src/mock/animation_builder_mock';

View File

@ -0,0 +1 @@
export * from 'angular2/src/http/backends/mock_backend';

View File

@ -1,5 +0,0 @@
export * from './src/mock/mock_location_strategy';
export {LocationStrategy} from './src/router/location_strategy';
export {MockViewResolver} from 'angular2/src/mock/view_resolver_mock';
export {MockXHR} from 'angular2/src/compiler/xhr_mock';

View File

@ -0,0 +1,2 @@
export * from 'angular2/src/mock/mock_location_strategy';
export * from 'angular2/src/mock/location_mock';

View File

@ -31,10 +31,10 @@ export class MockXHR extends XHR {
this._processRequest(this._requests.shift());
} while (this._requests.length > 0);
this.verifyNoOustandingExpectations();
this.verifyNoOutstandingExpectations();
}
verifyNoOustandingExpectations() {
verifyNoOutstandingExpectations() {
if (this._expectations.length === 0) return;
var urls = [];

View File

@ -7,7 +7,7 @@ import {ResponseOptions, BaseResponseOptions} from '../base_response_options';
import {Injectable} from 'angular2/core';
import {BrowserXhr} from './browser_xhr';
import {isPresent} from 'angular2/src/facade/lang';
import {Observable} from 'angular2/angular2';
import {Observable} from 'angular2/core';
import {isSuccess, getResponseURL} from '../http_utils';
/**
* Creates connections using `XMLHttpRequest`. Given a fully-qualified

View File

@ -24,7 +24,7 @@ import {
RouteDefinition
} from './route_config_impl';
import {reflector} from 'angular2/src/core/reflection/reflection';
import {Injectable} from 'angular2/angular2';
import {Injectable} from 'angular2/core';
import {normalizeRouteConfig, assertComponentExists} from './route_config_nomalizer';
import {parser, Url, pathSegmentsToUrl} from './url_parser';

View File

@ -33,6 +33,7 @@ import {
Validators,
Validator
} from 'angular2/common';
import {Provider, forwardRef, Input} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {ListWrapper} from 'angular2/src/facade/collection';
import {ObservableWrapper} from 'angular2/src/facade/async';

View File

@ -521,6 +521,9 @@ var NG_ALL = [
'COMMON_PIPES',
'PLATFORM_PIPES:js',
'DOCUMENT',
'DomAdapter:dart',
'DomAdapter.attrToPropMap',
'DomAdapter.attrToPropMap=',
'DatePipe',
'DatePipe.supports()',
'DatePipe.transform()',

View File

@ -14,3 +14,9 @@ export {
} from './src/testing/test_component_builder';
export * from './src/testing/test_injector';
export * from './src/testing/fake_async';
export {MockViewResolver} from 'angular2/src/mock/view_resolver_mock';
export {MockXHR} from 'angular2/src/compiler/xhr_mock';
export {MockNgZone} from 'angular2/src/mock/ng_zone_mock';
export {MockApplicationRef} from 'angular2/src/mock/mock_application_ref';
export {MockDirectiveResolver} from 'angular2/src/mock/directive_resolver_mock';

View File

@ -17,6 +17,7 @@ var global_excludes = [
'angular2/http*',
'angular2/upgrade*',
'angular2/examples/**/ts/**/*',
'angular2/http/**/*',
'angular2/src/http/**/*',
'angular2/test/http/**/*',
'angular2/src/upgrade/**/*',