11import { Context , Failure , TestError , TestLabel , TestLogs } from '@ephox/bedrock-common' ;
2- import { it } from './Bdd' ;
2+ import { describe , it } from './Bdd' ;
33
44type TestLogs = TestLogs . TestLogs ;
55type TestError = TestError . TestError ;
@@ -10,11 +10,13 @@ export type FailureCallback = (error: TestThrowable, logs?: TestLogs) => void;
1010
1111/** An asynchronous test with callbacks. */
1212export const asyncTest = ( name : string , test : ( this : Context , success : SuccessCallback , failure : FailureCallback ) => void ) : void => {
13- it ( name , function ( done ) {
14- test . call ( this , ( ) => done ( ) , ( ( err , logs ) => {
15- const r = Failure . prepFailure ( err , logs ) ;
16- done ( r ) ;
17- } ) ) ;
13+ describe ( 'old-style test' , ( ) => {
14+ it ( name , function ( done ) {
15+ test . call ( this , ( ) => done ( ) , ( ( err , logs ) => {
16+ const r = Failure . prepFailure ( err , logs ) ;
17+ done ( r ) ;
18+ } ) ) ;
19+ } ) ;
1820 } ) ;
1921} ;
2022
@@ -23,10 +25,14 @@ export const asynctest = asyncTest;
2325
2426/** A synchronous test that fails if an exception is thrown */
2527export const test = ( name : string , test : ( this : Context ) => void ) : void => {
26- it ( name , test ) ;
28+ describe ( 'old-style test' , ( ) => {
29+ it ( name , test ) ;
30+ } ) ;
2731} ;
2832
2933/** Tests an async function (function that returns a Promise). */
3034export const promiseTest = ( name : string , test : ( this : Context ) => Promise < void > ) : void => {
31- it ( name , test ) ;
35+ describe ( 'old-style test' , ( ) => {
36+ it ( name , test ) ;
37+ } ) ;
3238} ;
0 commit comments