From 4152aab738a6e2cc46bd7d20846a4056a6ad2c6e Mon Sep 17 00:00:00 2001 From: Gibah Joseph Date: Fri, 8 Nov 2024 19:08:25 +0000 Subject: [PATCH] test(annotations): fixed failing test --- .../test/openapi_generator_annotations_test.dart | 2 +- openapi-generator/test/utils.dart | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openapi-generator-annotations/test/openapi_generator_annotations_test.dart b/openapi-generator-annotations/test/openapi_generator_annotations_test.dart index 52e4ade..21e6e0a 100644 --- a/openapi-generator-annotations/test/openapi_generator_annotations_test.dart +++ b/openapi-generator-annotations/test/openapi_generator_annotations_test.dart @@ -257,7 +257,7 @@ void main() { generatorName: Generator.dart, ); expect(openapi.toString(), - contains('cleanSubOutputDirectory: [lib/src]')); + contains('cleanSubOutputDirectory: ["lib/src"]')); }); test('should include skipSpecValidation when set', () { diff --git a/openapi-generator/test/utils.dart b/openapi-generator/test/utils.dart index 8ad0c2f..17ab961 100644 --- a/openapi-generator/test/utils.dart +++ b/openapi-generator/test/utils.dart @@ -74,11 +74,13 @@ Future generateFromPath( Future generateFromAnnotation(Openapi openapi, {ProcessRunner? process, String path = 'lib/myapp.dart'}) { - expect(openapi.inputSpec is RemoteSpec, isFalse, - reason: 'Please use a local spec for tests.'); + String? specPath = null; + if (openapi.inputSpec is! RemoteSpec) { + specPath = openapi.inputSpec.path; + } return generateFromSource(openapi.toString(), process: process, - openapiSpecFilePath: openapi.inputSpec.path, + openapiSpecFilePath: specPath, path: path); }