feat: Add triggerQuitOnInitForTest to GameScreen for deterministic testing
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -56,20 +56,14 @@ void main() {
|
||||
home: GameScreen(
|
||||
wolf3d: wolf3d,
|
||||
skipEngineBootstrapForTest: true,
|
||||
triggerQuitOnInitForTest: true,
|
||||
appExitHandler: () async {
|
||||
appExitCallCount++;
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final dynamic state = tester.state(find.byType(GameScreen));
|
||||
|
||||
await Future.wait<void>([
|
||||
state.debugQuitForTest() as Future<void>,
|
||||
state.debugQuitForTest() as Future<void>,
|
||||
state.debugQuitForTest() as Future<void>,
|
||||
]);
|
||||
await tester.pump(const Duration(milliseconds: 10));
|
||||
|
||||
expect(audio.stopAllAudioCallCount, 1);
|
||||
expect(audio.disposeCallCount, 1);
|
||||
|
||||
Reference in New Issue
Block a user