2015-10-13 03:29:13 -04:00
|
|
|
library angular2.src.testing.testing_internal;
|
2014-09-30 14:56:33 -04:00
|
|
|
|
2016-02-10 19:54:32 -05:00
|
|
|
import 'testing_internal_core.dart' as core;
|
|
|
|
export 'testing_internal_core.dart'
|
2015-06-02 15:33:08 -04:00
|
|
|
hide
|
2016-02-10 19:54:32 -05:00
|
|
|
beforeEachProviders,
|
|
|
|
beforeEachBindings,
|
2015-06-02 15:33:08 -04:00
|
|
|
beforeEach,
|
|
|
|
it,
|
|
|
|
iit,
|
|
|
|
xit,
|
2016-02-10 19:54:32 -05:00
|
|
|
testSetup,
|
|
|
|
describe,
|
|
|
|
ddescribe,
|
|
|
|
xdescribe;
|
2015-03-13 06:10:11 -04:00
|
|
|
|
2016-02-10 19:54:32 -05:00
|
|
|
import 'package:angular2/platform/testing/browser.dart';
|
2016-02-25 17:24:17 -05:00
|
|
|
import 'package:angular2/src/facade/collection.dart' show StringMapWrapper;
|
|
|
|
import "package:angular2/src/core/zone/ng_zone.dart" show NgZone;
|
2015-03-13 06:10:11 -04:00
|
|
|
|
2015-07-17 17:01:55 -04:00
|
|
|
export 'test_injector.dart' show inject;
|
2015-03-13 06:10:11 -04:00
|
|
|
|
2015-05-05 15:59:54 -04:00
|
|
|
void testSetup() {
|
2016-02-10 19:54:32 -05:00
|
|
|
core.setDartBaseTestProviders(TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS);
|
2015-03-13 06:10:11 -04:00
|
|
|
}
|
|
|
|
|
2015-10-11 01:11:13 -04:00
|
|
|
void beforeEachProviders(Function fn) {
|
2016-02-10 19:54:32 -05:00
|
|
|
testSetup();
|
|
|
|
core.beforeEachProviders(fn);
|
2014-09-30 14:56:33 -04:00
|
|
|
}
|
|
|
|
|
2015-10-11 01:11:13 -04:00
|
|
|
@Deprecated('using beforeEachProviders instead')
|
|
|
|
void beforeEachBindings(Function fn) {
|
|
|
|
beforeEachProviders(fn);
|
|
|
|
}
|
|
|
|
|
2015-10-08 18:33:17 -04:00
|
|
|
void beforeEach(fn) {
|
2016-02-10 19:54:32 -05:00
|
|
|
testSetup();
|
|
|
|
core.beforeEach(fn);
|
2014-11-20 15:07:48 -05:00
|
|
|
}
|
|
|
|
|
2015-06-02 10:29:09 -04:00
|
|
|
void it(name, fn, [timeOut = null]) {
|
2016-02-10 19:54:32 -05:00
|
|
|
core.it(name, fn, timeOut);
|
2015-03-13 06:10:11 -04:00
|
|
|
}
|
2014-09-30 14:56:33 -04:00
|
|
|
|
2015-06-02 10:29:09 -04:00
|
|
|
void iit(name, fn, [timeOut = null]) {
|
2016-02-10 19:54:32 -05:00
|
|
|
core.iit(name, fn, timeOut);
|
2015-03-13 06:10:11 -04:00
|
|
|
}
|
2014-09-30 14:56:33 -04:00
|
|
|
|
2015-06-02 10:29:09 -04:00
|
|
|
void xit(name, fn, [timeOut = null]) {
|
2016-02-10 19:54:32 -05:00
|
|
|
core.xit(name, fn, timeOut);
|
2015-02-17 17:30:08 -05:00
|
|
|
}
|
|
|
|
|
2016-02-10 19:54:32 -05:00
|
|
|
void describe(name, fn) {
|
|
|
|
testSetup();
|
|
|
|
core.describe(name, fn);
|
2015-04-17 19:08:59 -04:00
|
|
|
}
|
|
|
|
|
2016-02-10 19:54:32 -05:00
|
|
|
void ddescribe(name, fn) {
|
|
|
|
testSetup();
|
|
|
|
core.ddescribe(name, fn);
|
2015-04-14 21:01:44 -04:00
|
|
|
}
|
|
|
|
|
2016-02-10 19:54:32 -05:00
|
|
|
void xdescribe(name, fn) {
|
|
|
|
testSetup();
|
|
|
|
core.xdescribe(name, fn);
|
2016-02-25 17:24:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bool isInInnerZone() => NgZone.isInAngularZone();
|