1
1
const testWithServer = require ( './helpers/test-with-server' ) ;
2
+ const dir = __dirname . split ( '/' ) [ __dirname . split ( '/' ) . length - 1 ] ;
3
+ const file = dir + __filename . replace ( __dirname , '' ) + ' > ' ;
2
4
3
- testWithServer ( 'Request for HTML Content' , { } , ( t , ctx ) => {
5
+ testWithServer ( file + 'Request for HTML Content' , { } , ( t , ctx ) => {
4
6
t . plan ( 2 ) ;
5
7
6
8
const htmlRequest = {
@@ -16,7 +18,7 @@ testWithServer('Request for HTML Content', {}, (t, ctx) => {
16
18
} ) ;
17
19
} ) ;
18
20
19
- testWithServer ( 'Request for JSONAPI Content' , { } , ( t , ctx ) => {
21
+ testWithServer ( file + 'Request for JSONAPI Content' , { } , ( t , ctx ) => {
20
22
// http://jsonapi.org/format/#content-negotiation-servers
21
23
//
22
24
// Servers MUST send all JSON API data in response documents with the header
@@ -35,7 +37,7 @@ testWithServer('Request for JSONAPI Content', {}, (t, ctx) => {
35
37
} ) ;
36
38
} ) ;
37
39
38
- testWithServer ( 'Request with multiple instances of JSONAPI media type, one without parameters' , { } , ( t , ctx ) => {
40
+ testWithServer ( file + 'Request with multiple instances of JSONAPI media type, one without parameters' , { } , ( t , ctx ) => {
39
41
t . plan ( 1 ) ;
40
42
41
43
const acceptableJSONRequest = {
@@ -50,7 +52,7 @@ testWithServer('Request with multiple instances of JSONAPI media type, one witho
50
52
} ) ;
51
53
} ) ;
52
54
53
- testWithServer ( 'Not acceptable request when to accept header' , { } , ( t , ctx ) => {
55
+ testWithServer ( file + 'Not acceptable request when to accept header' , { } , ( t , ctx ) => {
54
56
t . plan ( 1 ) ;
55
57
56
58
const acceptableJSONRequest = {
@@ -64,7 +66,7 @@ testWithServer('Not acceptable request when to accept header', {}, (t, ctx) => {
64
66
} ) ;
65
67
} ) ;
66
68
67
- testWithServer ( 'Not acceptable if json and html header are defined at the same time' , { } , ( t , ctx ) => {
69
+ testWithServer ( file + 'Not acceptable if json and html header are defined at the same time' , { } , ( t , ctx ) => {
68
70
t . plan ( 1 ) ;
69
71
70
72
const acceptableJSONRequest = {
@@ -79,7 +81,7 @@ testWithServer('Not acceptable if json and html header are defined at the same t
79
81
} ) ;
80
82
} ) ;
81
83
82
- testWithServer ( 'Return html if user agent is twitter bot' , { } , ( t , ctx ) => {
84
+ testWithServer ( file + 'Return html if user agent is twitter bot' , { } , ( t , ctx ) => {
83
85
t . plan ( 1 ) ;
84
86
85
87
const acceptableJSONRequest = {
@@ -94,7 +96,7 @@ testWithServer('Return html if user agent is twitter bot', {}, (t, ctx) => {
94
96
} ) ;
95
97
} ) ;
96
98
97
- testWithServer ( 'Not acceptable if no accept header and no user-agent twitter' , { } , ( t , ctx ) => {
99
+ testWithServer ( file + 'Not acceptable if no accept header and no user-agent twitter' , { } , ( t , ctx ) => {
98
100
t . plan ( 1 ) ;
99
101
100
102
const acceptableJSONRequest = {
0 commit comments