Git Product home page Git Product logo

snapshottestingheic's Introduction

🗜 SnapshotTestingHEIC

Swift 5.2 Build Status

An extension to SnapshotTesting which allows you to create HEIC images. The benefit of using HEIC instead of PNG is that it can store as much as image quality as PNG, but with a smaller file size. You can verify this by looking at SnapshotTestingHEICTests.

Usage

Once installed, no additional configuration is required. You can import the SnapshotTestingHEIC module, call SnapshotTesting following their usage guide and simply provide our imageHEIC strategy as below.

import XCTest
import SnapshotTesting
import SnapshotTestingHEIC

class MyViewControllerTests: XCTestCase {
  func testMyViewController() {
    let vc = MyViewController()
    assertSnapshot(matching: vc, as: .imageHEIC)
  }
}

Installation

Xcode 11

⚠️ Warning: By default, Xcode will try to add the SnapshotTestingHEIC package to your project's main application/framework target. Please ensure that SnapshotTestingHEIC is added to a test target instead, as documented in the last step, below.

  1. From the File menu, navigate through Swift Packages and select Add Package Dependency….
  2. Enter package repository URL: https://github.com/alexey1312/SnapshotTestingHEIC
  3. Confirm the version and let Xcode resolve the package
  4. On the final dialog, update SnapshotTestingHEIC's Add to Target column to a test target that will contain snapshot tests (if you have more than one test target, you can later add SnapshotTestingHEIC to them by manually linking the library in its build phase)

Swift Package Manager

If you want to use SnapshotTestingHEIC in any other project that uses Swift Package Manager, add the package as a dependency in Package.swift:

dependencies: [
  .package(name: "SnapshotTestingStitch", url: "https://github.com/alexey1312/SnapshotTestingHEIC.git", from: "1.0.0"),
]

Next, add SnapshotTestingHEIC as a dependency of your test target:

targets: [
  .target(
    name: "MyApp"
  ),
  
  .testTarget(
    name: "MyAppTests", 
    dependencies: [
      .target(name: "MyApp"),
      .product(name: "SnapshotTestingHEIC", package: "SnapshotTestingHEIC"),
    ]
  ),
]

Other

We do not currently support distribution through CocoaPods or Carthage.

License

This library is released under the MIT license. See LICENSE for details.

snapshottestingheic's People

Contributors

alexey1312 avatar antranapp avatar gxs-antran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.