test(storage): increase code coverage #650
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes multiple changes to improve code functionality, enhance test coverage, and update dependencies. The most important changes include enabling code coverage in the Xcode scheme, adding new helper methods and extensions, updating the
StorageFileApi
class, and adding new test cases.Enhancements to Code Functionality:
.swiftpm/xcode/xcshareddata/xcschemes/Storage.xcscheme
: Enabled code coverage and addedStorageTests
as a testable reference. [1] [2]Sources/Helpers/Codable.swift
: Added a newJSONDecoder
extension with a default decoder for Supabase.Sources/Helpers/HTTP/HTTPFields.swift
: Added a newappendOrUpdate
method toHTTPFields
for updating header values. [1] [2]Updates to
StorageFileApi
Class:Sources/Storage/StorageFileApi.swift
: Updated theStorageFileApi
class to useJSONEncoder.unconfiguredEncoder
and modified themakeSignedURL
method to handleString
instead ofURL
. [1] [2] [3] [4] [5] [6] [7] [8]Test Coverage Enhancements:
Tests/StorageTests/BucketOptionsTests.swift
: Added new test cases forBucketOptions
to verify default and custom initialization.Tests/StorageTests/FileOptionsTests.swift
: Added new test cases forFileOptions
to verify default and custom initialization.Tests/StorageTests/MultipartFormDataTests.swift
: Added new test cases forMultipartFormData
to test boundary generation, data appending, and content headers.Dependency Updates:
Package.swift
: AddedMocker
andTestHelpers
dependencies and included a new resource directoryFixtures
.Deprecated Code Updates:
Sources/Storage/Codable.swift
: MarkeddefaultStorageEncoder
anddefaultStorageDecoder
as deprecated.Sources/Storage/Deprecated.swift
: Updated deprecation messages for initializers and deprecated structs. [1] [2] [3]