Skip to content

Commit ca5a4a8

Browse files
fix: learn file controller test (#1596)
1 parent 35c171d commit ca5a4a8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

mobile-app/test/unit/learn_file_controller_test.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ void main() {
277277

278278
group('parseJsDocumentsAsScriptTags function', () {
279279
testWidgets(
280-
'it should inject script content if JS file is linked when babelController is null',
280+
'it should throw an error if JS file is linked when babelController is null',
281281
(tester) async {
282282
Challenge jsChallenge = Challenge(
283283
id: '4',
@@ -313,9 +313,10 @@ void main() {
313313
],
314314
);
315315
String html = jsChallenge.files[0].contents;
316-
String result = await service
317-
.parseJsDocumentsAsScriptTags(jsChallenge, html, null, testing: true);
318-
expect(result, contains('console.log("hello");'));
316+
expect(
317+
() async => await service.parseJsDocumentsAsScriptTags(jsChallenge, html, null, testing: true),
318+
throwsA(isA<Exception>().having((e) => e.toString(), 'description', contains('Babel controller is required to transpile JS code.'))),
319+
);
319320
});
320321
});
321322

0 commit comments

Comments
 (0)