Skip to content

Commit

Permalink
INTL-1504: updated the test file
Browse files Browse the repository at this point in the history
  • Loading branch information
chetansinghchoudhary-wk committed Sep 13, 2023
1 parent 5e38c29 commit 087fe95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/executables/intl_message_migration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void main() {
expectedOutput: expectedOutputFiles(
additionalFilesInLib: [extraOutput()],
messages: [...defaultMessages, ...extraMessages, ...longMessages]
..sort()),
..sort(), useRelativeImport: true),
args: ['--yes-to-all']);

// Test that additional information (desc, meaning) are preserved if we read and then rewrite the file.
Expand Down Expand Up @@ -301,7 +301,11 @@ d.DirectoryDescriptor expectedOutputFiles(
{Iterable<d.Descriptor> additionalFilesInLib = const [],
List<String> messages = defaultMessages,
String rmuiVersionConstraint = '^1.1.1',
String intlImport = '${wIntl}/intl_wrapper.dart'}) {
String intlImport = '${wIntl}/intl_wrapper.dart',
bool useRelativeImport = false,
}) {
String importFormat = useRelativeImport ? 'package' : 'relative';

return d.dir('project', [
// Note that the codemod doesn't currently add the intl dependency to the pubspec.
d.file('pubspec.yaml', /*language=yaml*/ '''
Expand All @@ -318,7 +322,7 @@ dependencies:
...additionalFilesInLib,
d.file('usage.dart', /*language=dart*/ '''
import 'package:react_material_ui/react_material_ui.dart' as mui;
import 'package:test_project/src/intl/test_project_intl.dart';
import ${importFormat} == 'package' ? 'package:test_project/src/intl/test_project_intl.dart' : '../intl/test_project_intl.dart';
usage() => (mui.Button()..aria.label=TestProjectIntl.sortsLater)(TestProjectIntl.literalString);'''),
d.dir('src', [
Expand Down

0 comments on commit 087fe95

Please sign in to comment.