11import * as fs from 'node:fs' ;
22import * as path from 'node:path' ;
3- /* eslint-disable jest/expect-expect */
43import { Integration } from '../../lib/Constants' ;
54import {
65 KEYS ,
@@ -32,7 +31,8 @@ describe('Flutter', () => {
3231 'to track the performance of your application?' ,
3332 ) ;
3433
35- const profilingOptionPrompted = tracingOptionPrompted &&
34+ const profilingOptionPrompted =
35+ tracingOptionPrompted &&
3636 ( await wizardInstance . sendStdinAndWaitForOutput (
3737 [ KEYS . ENTER ] ,
3838 // "Do you want to enable Profiling", sometimes doesn't work as `Profiling` can be printed in bold.
@@ -68,13 +68,25 @@ describe('Flutter', () => {
6868 } ) ;
6969
7070 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+ ) ;
7379 } ) ;
7480
7581 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+ ) ;
7890 } ) ;
7991
8092 test ( 'builds correctly' , async ( ) => {
@@ -84,7 +96,6 @@ describe('Flutter', () => {
8496
8597 describe ( 'without apple platforms' , ( ) => {
8698 beforeAll ( async ( ) => {
87-
8899 const wizardInstance = startWizardInstance ( integration , projectDir ) ;
89100
90101 if ( fs . existsSync ( `${ projectDir } /ios` ) ) {
@@ -94,15 +105,15 @@ describe('Flutter', () => {
94105 fs . renameSync ( `${ projectDir } /macos` , `${ projectDir } /_macos` ) ;
95106 }
96107
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?' ) ;
100110
101- const tracingOptionPrompted = continueOnUncommitedFilesPromted &&
111+ const tracingOptionPrompted =
112+ continueOnUncommitedFilesPromted &&
102113 ( 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?' ,
106117 ) ) ;
107118
108119 tracingOptionPrompted &&
@@ -120,7 +131,10 @@ describe('Flutter', () => {
120131 } ) ;
121132
122133 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+ ) ;
124138 expect ( fileContent ) . not . toContain ( `options.profilesSampleRate = 1.0;` ) ;
125139 } ) ;
126140 } ) ;
0 commit comments