Skip to content

Commit

Permalink
fix: Set explicit return types in test tools code. (serverpod#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
hampuslavin authored Oct 22, 2024
1 parent 37faa92 commit aefba28
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'package:serverpod_test_module_server/src/generated/endpoints.dart';
export 'package:serverpod_test/serverpod_test_public_exports.dart';

@_i1.isTestGroup
withServerpod(
void withServerpod(
String testGroupName,
_i1.TestClosure<TestEndpoints> testClosure, {
String? runMode,
Expand Down Expand Up @@ -55,7 +55,7 @@ class TestEndpoints {
class _InternalTestEndpoints extends TestEndpoints
implements _i1.InternalTestEndpoints {
@override
initialize(
void initialize(
_i2.SerializationManager serializationManager,
_i2.EndpointDispatch endpoints,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import 'package:serverpod_test_server/src/generated/endpoints.dart';
export 'package:serverpod_test/serverpod_test_public_exports.dart';

@_i1.isTestGroup
withServerpod(
void withServerpod(
String testGroupName,
_i1.TestClosure<TestEndpoints> testClosure, {
String? runMode,
Expand Down Expand Up @@ -156,7 +156,7 @@ class TestEndpoints {
class _InternalTestEndpoints extends TestEndpoints
implements _i1.InternalTestEndpoints {
@override
initialize(
void initialize(
_i2.SerializationManager serializationManager,
_i2.EndpointDispatch endpoints,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ class ServerTestToolsGenerator {
(methodBuilder) {
methodBuilder
..name = 'initialize'
..returns = refer('void')
..annotations.add(refer('override'))
..requiredParameters.add(
Parameter(
Expand Down Expand Up @@ -384,6 +385,7 @@ class ServerTestToolsGenerator {
return Method((methodBuilder) {
methodBuilder
..name = 'withServerpod'
..returns = refer('void')
..annotations.add(refer('isTestGroup', serverpodTestUrl))
..requiredParameters.addAll([
Parameter((p) => p
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void main() {
testToolsFile,
matches(
r'@_i\d\.isTestGroup\n'
r'withServerpod\(\n'
r'void withServerpod\(\n'
r' String testGroupName,\n'
r' _i\d\.TestClosure<TestEndpoints> testClosure, \{\n'
r' String\? runMode,\n'
Expand Down Expand Up @@ -138,7 +138,7 @@ void main() {
testToolsFile,
matches(
r'@_i\d\.isTestGroup\n'
r'withServerpod\(\n'
r'void withServerpod\(\n'
r' String testGroupName,\n'
r' _i\d\.TestClosure<TestEndpoints> testClosure, \{\n'
r' String\? runMode,\n'
Expand Down Expand Up @@ -183,7 +183,7 @@ void main() {
testToolsFile,
matches(
r'@_i\d\.isTestGroup\n'
r'withServerpod\(\n'
r'void withServerpod\(\n'
r' String testGroupName,\n'
r' _i\d\.TestClosure<TestEndpoints> testClosure, \{\n'
r' String\? runMode,\n'
Expand Down Expand Up @@ -263,7 +263,7 @@ void main() {
testToolsFile,
matches(
r'@_i\d\.isTestGroup\n'
r'withServerpod\(\n'
r'void withServerpod\(\n'
r' String testGroupName,\n'
r' _i\d\.TestClosure<TestEndpoints> testClosure, \{\n'
r' String\? runMode,\n'
Expand Down

0 comments on commit aefba28

Please sign in to comment.