Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to organise test files #327

Open
onmyway133 opened this issue Jun 25, 2019 · 0 comments
Open

How to organise test files #327

onmyway133 opened this issue Jun 25, 2019 · 0 comments

Comments

@onmyway133
Copy link
Owner

In terms of tests, we usually have files for unit test, UI test, integeration test and mock.

Out of sight, out of mind.

Unit tests are for checking specific functions and classes, it's more convenient to browse them side by side with source file. For example in Javascript, Kotlin and Swift

index.js
index.test.js
index.mock.js
LocationManager.kt
LocationManager.mock.kt
LocationManager.test.kt
BasketHandler.swift
BasketHandler.mock.swift
BasketHandler.test.swift

Integration tests check features or sub features, and may cover many source files, it's better to place them in feature folders

- Features
  - Cart
    - Sources
    - Tests
      - Cart.test.swift
      - Validator.test.swift
  - Profile
    - Sources
    - Tests
      - Updater.test.swift
      - AvatarUploader.test.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant