Skip to content

Commit

Permalink
test: add additional test validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
SandPod committed Nov 25, 2024
1 parent cd141f0 commit b500922
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,28 @@ class ExampleClass {}
completion(false),
);
});

test(
'when the file context is updated with a new endpoint file '
'then true is returned.', () async {
var newEndpointFile =
File(path.join(trackedDirectory.path, 'new_endpoint.dart'));
newEndpointFile.createSync(recursive: true);
newEndpointFile.writeAsStringSync('''
import 'package:serverpod/serverpod.dart';
class NewEndpoint extends Endpoint {
Future<String> hello(Session session, String name) async {
return 'Hello \$name';
});
}
''');

await expectLater(
analyzer.updateFileContexts({newEndpointFile.path}),
completion(true),
);
});
});

group('Given a tracked and analyzed directory with valid non-endpoint file',
Expand Down

0 comments on commit b500922

Please sign in to comment.