Sha256: cb29e678ed38671eb4a4054ee4289bcd1c2fe80647c87d337f748f9d03b3be19

Contents?: true

Size: 1.35 KB

Versions: 49

Compression:

Stored size: 1.35 KB

Contents

## Testing

The project employs a diverse suite tests that help ensure it works as intended and prevents regressions as it continues to grow and evolve.

### Unit Tests
Most of the internal components the project uses have unit tests to thoroughly test them. Here dependencies of components are mocked or stubbed appropriately to ensure tests are reliable, test only one component and are fast!

### Acceptance Tests

Acceptance tests run the built `shopify` command line against a wide range of fixtures and verify its output and results. They are the slowest to run however provide the most coverage. The idea is to test a few complete scenarios for each major feature.

Those are written in [Cucumber](https://cucumber.io/) and Ruby and can be found in the [`features/`](/features) directory. They can be executed by running:

```bash
bundle exec cucumber
bundle exec cucumber features/theme.feature:3 # A specific test
```

> **Note** that we currently don't have an approach for stubbing the interactions with the GraphQL APIs and that therefore we can't write acceptance tests for commands that interact with APIs.

#### Debugging acceptance tests
When developing acceptance tests, it can be helpful to see the outputs of running commands.
To see outputs, append `--verbose` when running an acceptance test. Example:

```sh
bundle exec cucumber features/theme.feature --verbose
```

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 docs/contributors/testing.md
shopify-cli-2.35.0 docs/contributors/testing.md
shopify-cli-2.34.0 docs/contributors/testing.md
shopify-cli-2.33.1 docs/contributors/testing.md
shopify-cli-2.33.0 docs/contributors/testing.md
shopify-cli-2.32.1 docs/contributors/testing.md
shopify-cli-2.32.0 docs/contributors/testing.md
shopify-cli-2.31.0 docs/contributors/testing.md
shopify-cli-2.30.0 docs/contributors/testing.md
shopify-cli-2.29.0 docs/contributors/testing.md
shopify-cli-2.28.0 docs/contributors/testing.md
shopify-cli-2.27.0 docs/contributors/testing.md
shopify-cli-2.26.0 docs/contributors/testing.md
shopify-cli-2.25.0 docs/contributors/testing.md
shopify-cli-2.24.0 docs/contributors/testing.md
shopify-cli-2.23.0 docs/contributors/testing.md
shopify-cli-2.22.0 docs/contributors/testing.md
shopify-cli-2.21.0 docs/contributors/testing.md
shopify-cli-2.20.1 docs/contributors/testing.md
shopify-cli-2.20.0 docs/contributors/testing.md