1
1
import * as fs from 'node:fs' ;
2
2
import * as path from 'node:path' ;
3
- /* eslint-disable jest/expect-expect */
4
3
import { Integration } from '../../lib/Constants' ;
5
4
import {
6
5
KEYS ,
@@ -32,7 +31,8 @@ describe('Flutter', () => {
32
31
'to track the performance of your application?' ,
33
32
) ;
34
33
35
- const profilingOptionPrompted = tracingOptionPrompted &&
34
+ const profilingOptionPrompted =
35
+ tracingOptionPrompted &&
36
36
( await wizardInstance . sendStdinAndWaitForOutput (
37
37
[ KEYS . ENTER ] ,
38
38
// "Do you want to enable Profiling", sometimes doesn't work as `Profiling` can be printed in bold.
@@ -68,13 +68,25 @@ describe('Flutter', () => {
68
68
} ) ;
69
69
70
70
test ( 'lib/main.dart calls sentry init' , ( ) => {
71
- checkFileContents ( `${ projectDir } /lib/main.dart` , `import 'package:sentry_flutter/sentry_flutter.dart';` ) ;
72
- checkFileContents ( `${ projectDir } /lib/main.dart` , `await SentryFlutter.init(` ) ;
71
+ checkFileContents (
72
+ `${ projectDir } /lib/main.dart` ,
73
+ `import 'package:sentry_flutter/sentry_flutter.dart';` ,
74
+ ) ;
75
+ checkFileContents (
76
+ `${ projectDir } /lib/main.dart` ,
77
+ `await SentryFlutter.init(` ,
78
+ ) ;
73
79
} ) ;
74
80
75
81
test ( 'lib/main.dart enables tracing and profiling' , ( ) => {
76
- checkFileContents ( `${ projectDir } /lib/main.dart` , `options.tracesSampleRate = 1.0;` ) ;
77
- checkFileContents ( `${ projectDir } /lib/main.dart` , `options.profilesSampleRate = 1.0;` ) ;
82
+ checkFileContents (
83
+ `${ projectDir } /lib/main.dart` ,
84
+ `options.tracesSampleRate = 1.0;` ,
85
+ ) ;
86
+ checkFileContents (
87
+ `${ projectDir } /lib/main.dart` ,
88
+ `options.profilesSampleRate = 1.0;` ,
89
+ ) ;
78
90
} ) ;
79
91
80
92
test ( 'builds correctly' , async ( ) => {
@@ -84,7 +96,6 @@ describe('Flutter', () => {
84
96
85
97
describe ( 'without apple platforms' , ( ) => {
86
98
beforeAll ( async ( ) => {
87
-
88
99
const wizardInstance = startWizardInstance ( integration , projectDir ) ;
89
100
90
101
if ( fs . existsSync ( `${ projectDir } /ios` ) ) {
@@ -94,15 +105,15 @@ describe('Flutter', () => {
94
105
fs . renameSync ( `${ projectDir } /macos` , `${ projectDir } /_macos` ) ;
95
106
}
96
107
97
- const continueOnUncommitedFilesPromted = await wizardInstance . waitForOutput (
98
- 'Do you want to continue anyway?'
99
- )
108
+ const continueOnUncommitedFilesPromted =
109
+ await wizardInstance . waitForOutput ( 'Do you want to continue anyway?' ) ;
100
110
101
- const tracingOptionPrompted = continueOnUncommitedFilesPromted &&
111
+ const tracingOptionPrompted =
112
+ continueOnUncommitedFilesPromted &&
102
113
( await wizardInstance . sendStdinAndWaitForOutput (
103
- [ KEYS . ENTER ] ,
104
- // "Do you want to enable Tracing", sometimes doesn't work as `Tracing` can be printed in bold.
105
- 'to track the performance of your application?' ,
114
+ [ KEYS . ENTER ] ,
115
+ // "Do you want to enable Tracing", sometimes doesn't work as `Tracing` can be printed in bold.
116
+ 'to track the performance of your application?' ,
106
117
) ) ;
107
118
108
119
tracingOptionPrompted &&
@@ -120,7 +131,10 @@ describe('Flutter', () => {
120
131
} ) ;
121
132
122
133
test ( 'lib/main.dart does not add profiling with missing ios and macos folder' , ( ) => {
123
- const fileContent = fs . readFileSync ( `${ projectDir } /lib/main.dart` , 'utf-8' ) ;
134
+ const fileContent = fs . readFileSync (
135
+ `${ projectDir } /lib/main.dart` ,
136
+ 'utf-8' ,
137
+ ) ;
124
138
expect ( fileContent ) . not . toContain ( `options.profilesSampleRate = 1.0;` ) ;
125
139
} ) ;
126
140
} ) ;
0 commit comments