@@ -27,19 +27,19 @@ function validate() {
27
27
28
28
{
29
29
// Test with no arguments.
30
- process . report . triggerReport ( ) ;
30
+ process . report . writeReport ( ) ;
31
31
validate ( ) ;
32
32
}
33
33
34
34
{
35
35
// Test with an error argument.
36
- process . report . triggerReport ( new Error ( 'test error' ) ) ;
36
+ process . report . writeReport ( new Error ( 'test error' ) ) ;
37
37
validate ( ) ;
38
38
}
39
39
40
40
{
41
41
// Test with a file argument.
42
- const file = process . report . triggerReport ( 'custom-name-1.json' ) ;
42
+ const file = process . report . writeReport ( 'custom-name-1.json' ) ;
43
43
const absolutePath = path . join ( tmpdir . path , file ) ;
44
44
assert . strictEqual ( helper . findReports ( process . pid , tmpdir . path ) . length , 0 ) ;
45
45
assert . strictEqual ( file , 'custom-name-1.json' ) ;
@@ -49,8 +49,8 @@ function validate() {
49
49
50
50
{
51
51
// Test with file and error arguments.
52
- const file = process . report . triggerReport ( 'custom-name-2.json' ,
53
- new Error ( 'test error' ) ) ;
52
+ const file = process . report . writeReport ( 'custom-name-2.json' ,
53
+ new Error ( 'test error' ) ) ;
54
54
const absolutePath = path . join ( tmpdir . path , file ) ;
55
55
assert . strictEqual ( helper . findReports ( process . pid , tmpdir . path ) . length , 0 ) ;
56
56
assert . strictEqual ( file , 'custom-name-2.json' ) ;
@@ -61,7 +61,7 @@ function validate() {
61
61
{
62
62
// Test with a filename option.
63
63
process . report . filename = 'custom-name-3.json' ;
64
- const file = process . report . triggerReport ( ) ;
64
+ const file = process . report . writeReport ( ) ;
65
65
assert . strictEqual ( helper . findReports ( process . pid , tmpdir . path ) . length , 0 ) ;
66
66
const filename = path . join ( process . report . directory , 'custom-name-3.json' ) ;
67
67
assert . strictEqual ( file , process . report . filename ) ;
@@ -72,21 +72,21 @@ function validate() {
72
72
// Test with an invalid file argument.
73
73
[ null , 1 , Symbol ( ) , function ( ) { } ] . forEach ( ( file ) => {
74
74
common . expectsError ( ( ) => {
75
- process . report . triggerReport ( file ) ;
75
+ process . report . writeReport ( file ) ;
76
76
} , { code : 'ERR_INVALID_ARG_TYPE' } ) ;
77
77
} ) ;
78
78
79
79
// Test with an invalid error argument.
80
80
[ null , 1 , Symbol ( ) , function ( ) { } , 'foo' ] . forEach ( ( error ) => {
81
81
common . expectsError ( ( ) => {
82
- process . report . triggerReport ( 'file' , error ) ;
82
+ process . report . writeReport ( 'file' , error ) ;
83
83
} , { code : 'ERR_INVALID_ARG_TYPE' } ) ;
84
84
} ) ;
85
85
86
86
{
87
87
// Test the special "stdout" filename.
88
88
const args = [ '--experimental-report' , '-e' ,
89
- 'process.report.triggerReport ("stdout")' ] ;
89
+ 'process.report.writeReport ("stdout")' ] ;
90
90
const child = spawnSync ( process . execPath , args , { cwd : tmpdir . path } ) ;
91
91
assert . strictEqual ( child . status , 0 ) ;
92
92
assert . strictEqual ( child . signal , null ) ;
@@ -97,7 +97,7 @@ function validate() {
97
97
{
98
98
// Test the special "stderr" filename.
99
99
const args = [ '--experimental-report' , '-e' ,
100
- 'process.report.triggerReport ("stderr")' ] ;
100
+ 'process.report.writeReport ("stderr")' ] ;
101
101
const child = spawnSync ( process . execPath , args , { cwd : tmpdir . path } ) ;
102
102
assert . strictEqual ( child . status , 0 ) ;
103
103
assert . strictEqual ( child . signal , null ) ;
@@ -113,7 +113,7 @@ function validate() {
113
113
const args = [ '--experimental-report' ,
114
114
`--diagnostic-report-directory=${ reportDir } ` ,
115
115
'-e' ,
116
- 'process.report.triggerReport ()' ] ;
116
+ 'process.report.writeReport ()' ] ;
117
117
const child = spawnSync ( process . execPath , args , { cwd : tmpdir . path } ) ;
118
118
119
119
assert . strictEqual ( child . status , 0 ) ;
0 commit comments