@@ -809,14 +809,6 @@ getJasmineRequireObj().Spec = function(j$) {
809
809
this . result . properties [ key ] = value ;
810
810
} ;
811
811
812
- Spec . prototype . expect = function ( actual ) {
813
- return this . expectationFactory ( actual , this ) ;
814
- } ;
815
-
816
- Spec . prototype . expectAsync = function ( actual ) {
817
- return this . asyncExpectationFactory ( actual , this ) ;
818
- } ;
819
-
820
812
Spec . prototype . execute = function (
821
813
queueRunnerFactory ,
822
814
onComplete ,
@@ -1904,23 +1896,27 @@ getJasmineRequireObj().Env = function(j$) {
1904
1896
} ;
1905
1897
1906
1898
this . expect = function ( actual ) {
1907
- if ( ! runner . currentRunable ( ) ) {
1899
+ const runable = runner . currentRunable ( ) ;
1900
+
1901
+ if ( ! runable ) {
1908
1902
throw new Error (
1909
1903
"'expect' was used when there was no current spec, this could be because an asynchronous test timed out"
1910
1904
) ;
1911
1905
}
1912
1906
1913
- return runner . currentRunable ( ) . expect ( actual ) ;
1907
+ return runable . expectationFactory ( actual , runable ) ;
1914
1908
} ;
1915
1909
1916
1910
this . expectAsync = function ( actual ) {
1917
- if ( ! runner . currentRunable ( ) ) {
1911
+ const runable = runner . currentRunable ( ) ;
1912
+
1913
+ if ( ! runable ) {
1918
1914
throw new Error (
1919
1915
"'expectAsync' was used when there was no current spec, this could be because an asynchronous test timed out"
1920
1916
) ;
1921
1917
}
1922
1918
1923
- return runner . currentRunable ( ) . expectAsync ( actual ) ;
1919
+ return runable . asyncExpectationFactory ( actual , runable ) ;
1924
1920
} ;
1925
1921
1926
1922
this . beforeEach = function ( beforeEachFunction , timeout ) {
@@ -9755,14 +9751,6 @@ getJasmineRequireObj().Suite = function(j$) {
9755
9751
this . result . properties [ key ] = value ;
9756
9752
} ;
9757
9753
9758
- Suite . prototype . expect = function ( actual ) {
9759
- return this . expectationFactory ( actual , this ) ;
9760
- } ;
9761
-
9762
- Suite . prototype . expectAsync = function ( actual ) {
9763
- return this . asyncExpectationFactory ( actual , this ) ;
9764
- } ;
9765
-
9766
9754
Suite . prototype . getFullName = function ( ) {
9767
9755
const fullName = [ ] ;
9768
9756
for (
0 commit comments