Skip to content

Commit

Permalink
Fix template manifest test (#148616)
Browse files Browse the repository at this point in the history
`'flutter create should tool exit if the template manifest cannot be read'` fails consistently, as shown by #148614.

The test expects a `ToolExit` with the message "Unable to read the template manifest", but depending on how the test is being run, a different exception ("Cannot create a project within the Flutter SDK") is sometimes thrown first.

This pull request relocates the test project to `dev/` to prevent the extraneous error.
  • Loading branch information
nate-thegrate authored May 18, 2024
1 parent 791a782 commit adf279f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3776,16 +3776,15 @@ void main() {
'--no-pub',
'--template=plugin',
'--project-name=test',
projectDir.path,
'dev/test',
]),
throwsToolExit(message: 'Unable to read the template manifest at path'),
);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(
opHandle: (String context, FileSystemOp operation) {
if (operation == FileSystemOp.read && context.contains('template_manifest.json')) {
throw io.PathNotFoundException(
context, const OSError(), 'Cannot open file');
throw io.PathNotFoundException(context, const OSError(), 'Cannot open file');
}
},
),
Expand Down

0 comments on commit adf279f

Please sign in to comment.