Skip to content

Commit 4152aab

Browse files
committed
test(annotations): fixed failing test
1 parent 328c9da commit 4152aab

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

openapi-generator-annotations/test/openapi_generator_annotations_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void main() {
257257
generatorName: Generator.dart,
258258
);
259259
expect(openapi.toString(),
260-
contains('cleanSubOutputDirectory: [lib/src]'));
260+
contains('cleanSubOutputDirectory: ["lib/src"]'));
261261
});
262262

263263
test('should include skipSpecValidation when set', () {

openapi-generator/test/utils.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ Future<String> generateFromPath(
7474

7575
Future<String> generateFromAnnotation(Openapi openapi,
7676
{ProcessRunner? process, String path = 'lib/myapp.dart'}) {
77-
expect(openapi.inputSpec is RemoteSpec, isFalse,
78-
reason: 'Please use a local spec for tests.');
77+
String? specPath = null;
78+
if (openapi.inputSpec is! RemoteSpec) {
79+
specPath = openapi.inputSpec.path;
80+
}
7981
return generateFromSource(openapi.toString(),
8082
process: process,
81-
openapiSpecFilePath: openapi.inputSpec.path,
83+
openapiSpecFilePath: specPath,
8284
path: path);
8385
}
8486

0 commit comments

Comments
 (0)