@@ -9,41 +9,45 @@ const { db } = require("@arangodb");
99const base_url = `${ baseUrl } /` ;
1010
1111after ( function ( ) {
12- // cleanup collections if needed
13- const collections = [ /* list collections to truncate */ ] ;
14- collections . forEach ( name => {
15- let col = db . _collection ( name ) ;
16- if ( col ) col . truncate ( ) ;
17- } ) ;
12+ // cleanup collections if needed
13+ const collections = [
14+ /* list collections to truncate */
15+ ] ;
16+ collections . forEach ( ( name ) => {
17+ let col = db . _collection ( name ) ;
18+ if ( col ) col . truncate ( ) ;
19+ } ) ;
1820} ) ;
1921
2022describe ( "unit_version_router: the Foxx microservice version/ endpoint" , ( ) => {
21- beforeEach ( ( ) => {
22- // ensure collections exist & trimmed/initialized
23- const collections = [ /* list collections */ ] ;
24- collections . forEach ( name => {
25- let col = db . _collection ( name ) ;
26- if ( col ) {
27- col . truncate ( ) ;
28- } else {
29- db . _create ( name ) ;
30- }
23+ beforeEach ( ( ) => {
24+ // ensure collections exist & trimmed/initialized
25+ const collections = [
26+ /* list collections */
27+ ] ;
28+ collections . forEach ( ( name ) => {
29+ let col = db . _collection ( name ) ;
30+ if ( col ) {
31+ col . truncate ( ) ;
32+ } else {
33+ db . _create ( name ) ;
34+ }
35+ } ) ;
36+ } ) ;
37+
38+ it ( "should succeed when valid parameters given" , ( ) => {
39+ // arrange: setup fixture data
40+ // e.g., db.u.save({...}); db.mycoll.save({...});
41+ // TODO: insert required documents
42+
43+ // arrange: build request string
44+ const request_string = `${ base_url } /version` ;
45+
46+ // act
47+ const response = request . get ( request_string ) ;
48+
49+ // assert
50+ expect ( response . status ) . to . equal ( 200 ) ;
51+ // additional assertions on response body (if needed)
3152 } ) ;
32- } ) ;
33-
34- it ( "should succeed when valid parameters given" , ( ) => {
35- // arrange: setup fixture data
36- // e.g., db.u.save({...}); db.mycoll.save({...});
37- // TODO: insert required documents
38-
39- // arrange: build request string
40- const request_string = `${ base_url } /version` ;
41-
42- // act
43- const response = request . get ( request_string ) ;
44-
45- // assert
46- expect ( response . status ) . to . equal ( 200 ) ;
47- // additional assertions on response body (if needed)
48- } ) ;
4953} ) ;
0 commit comments