Skip to content

Commit

Permalink
fix: remove duplicate run test, fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexushunter committed Sep 2, 2023
1 parent 4eb64c9 commit 677a318
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void main() {
test('provides default yaml path', () {
expect(InputSpec.empty().path, 'openapi.yaml');
expect(InputSpec.empty().defaultYaml, isTrue);
expect(InputSpec.empty().defaultYaml, isFalse);
expect(InputSpec.empty().useYml, isFalse);
});
test('provides default yml path', () {
expect(InputSpec.emptyYml().path, 'openapi.yml');
Expand Down Expand Up @@ -193,22 +193,6 @@ void main() {
fail('Tests returned a non 0 exit code.');
}
});
test('env vars not provided', () async {
final result = Process.runSync(
'dart',
[
'test',
'test/remote_spec_header_delegates/aws_delegate_with_env_test.dart'
],
environment: {},
workingDirectory: Directory.current.path,
);

if (result.exitCode != 0) {
print(result.stderr);
fail('Tests returned a non 0 exit code.');
}
});
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions openapi-generator/lib/src/extensions/type_methods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ extension ReadProperty on ConstantReader {

if (isA(v, RemoteSpec)) {
final map = revived.namedArguments;
final delegate = map['headerDelegate']!;
final delegate = map['headerDelegate'];
final mapped = <String, dynamic>{
'path': convertToPropertyValue(map['path']!),
};
if (delegate.isNull) {
if (delegate?.isNull ?? true) {
return RemoteSpec.fromMap(mapped) as T;
} else {
final delegateReader = ConstantReader(delegate);
Expand Down

0 comments on commit 677a318

Please sign in to comment.